Submission #7632243
Source Code Expand
import sys sys.setrecursionlimit(500000) N,H = map(int,input().split()) A,B,C,D,E = map(int,input().split()) cost = [] def dfs(n,h,c): if n == N: cost.append(c) else: n += 1 if h - E > 0: dfs(n,h - E,c) dfs(n,h + B, c + A) dfs(n,h + D, c + C) dfs(0,H,0) print(min(cost))
Submission Info
Submission Time | |
---|---|
Task | C - 節制 |
User | dei |
Language | Python (3.4.3) |
Score | 10 |
Code Size | 317 Byte |
Status | TLE |
Exec Time | 2141 ms |
Memory | 602136 KB |
Judge Result
Set Name | Subtask1 | Subtask2 | Subtask3 | Subtask4 | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 10 / 10 | 0 / 30 | 0 / 60 | 0 / 1 | ||||||||||||||
Status |
|
|
|
|
Set Name | Test Cases |
---|---|
Subtask1 | sample_1.txt, sample_2.txt, sample_3.txt, 01_010.txt, 01_011.txt, 01_020.txt, 01_021.txt, 01_100.txt, 01_101.txt, 01_110.txt, 01_111.txt, 01_200.txt, 01_201.txt, 01_220.txt, 01_221.txt, 01_random01.txt, 01_random02.txt, 01_random03.txt, 01_random04.txt, 01_random05.txt, 01_random06.txt, 01_random07.txt, 01_random08.txt, 01_random09.txt, 01_random10.txt |
Subtask2 | sample_1.txt, sample_2.txt, sample_3.txt, 02_010.txt, 02_011.txt, 02_020.txt, 02_021.txt, 02_100.txt, 02_101.txt, 02_110.txt, 02_111.txt, 02_200.txt, 02_201.txt, 02_220.txt, 02_221.txt, 02_random01.txt, 02_random02.txt, 02_random03.txt, 02_random04.txt, 02_random05.txt, 02_random06.txt, 02_random07.txt, 02_random08.txt, 02_random09.txt, 02_random10.txt |
Subtask3 | sample_1.txt, sample_2.txt, sample_3.txt, sample_4.txt, 01_010.txt, 01_011.txt, 01_020.txt, 01_021.txt, 01_100.txt, 01_101.txt, 01_110.txt, 01_111.txt, 01_200.txt, 01_201.txt, 01_220.txt, 01_221.txt, 01_random01.txt, 01_random02.txt, 01_random03.txt, 01_random04.txt, 01_random05.txt, 01_random06.txt, 01_random07.txt, 01_random08.txt, 01_random09.txt, 01_random10.txt, 02_010.txt, 02_011.txt, 02_020.txt, 02_021.txt, 02_100.txt, 02_101.txt, 02_110.txt, 02_111.txt, 02_200.txt, 02_201.txt, 02_220.txt, 02_221.txt, 02_random01.txt, 02_random02.txt, 02_random03.txt, 02_random04.txt, 02_random05.txt, 02_random06.txt, 02_random07.txt, 02_random08.txt, 02_random09.txt, 02_random10.txt, 03_010.txt, 03_011.txt, 03_012.txt, 03_020.txt, 03_021.txt, 03_022.txt, 03_100.txt, 03_101.txt, 03_102.txt, 03_110.txt, 03_111.txt, 03_112.txt, 03_200.txt, 03_201.txt, 03_202.txt, 03_220.txt, 03_221.txt, 03_222.txt, 03_random01.txt, 03_random02.txt, 03_random03.txt, 03_random04.txt, 03_random05.txt, 03_random06.txt, 03_random07.txt, 03_random08.txt, 03_random09.txt, 03_random10.txt, 03_random11.txt, 03_random12.txt, 03_random13.txt, 03_random14.txt, 03_random15.txt, 03_random16.txt, 03_random17.txt, 03_random18.txt, 03_random19.txt, 03_random20.txt |
Subtask4 | 01_010.txt, 01_011.txt, 01_020.txt, 01_021.txt, 01_100.txt, 01_101.txt, 01_110.txt, 01_111.txt, 01_200.txt, 01_201.txt, 01_220.txt, 01_221.txt, 01_random01.txt, 01_random02.txt, 01_random03.txt, 01_random04.txt, 01_random05.txt, 01_random06.txt, 01_random07.txt, 01_random08.txt, 01_random09.txt, 01_random10.txt, 02_010.txt, 02_011.txt, 02_020.txt, 02_021.txt, 02_100.txt, 02_101.txt, 02_110.txt, 02_111.txt, 02_200.txt, 02_201.txt, 02_220.txt, 02_221.txt, 02_random01.txt, 02_random02.txt, 02_random03.txt, 02_random04.txt, 02_random05.txt, 02_random06.txt, 02_random07.txt, 02_random08.txt, 02_random09.txt, 02_random10.txt, 03_010.txt, 03_011.txt, 03_012.txt, 03_020.txt, 03_021.txt, 03_022.txt, 03_100.txt, 03_101.txt, 03_102.txt, 03_110.txt, 03_111.txt, 03_112.txt, 03_200.txt, 03_201.txt, 03_202.txt, 03_220.txt, 03_221.txt, 03_222.txt, 03_random01.txt, 03_random02.txt, 03_random03.txt, 03_random04.txt, 03_random05.txt, 03_random06.txt, 03_random07.txt, 03_random08.txt, 03_random09.txt, 03_random10.txt, 03_random11.txt, 03_random12.txt, 03_random13.txt, 03_random14.txt, 03_random15.txt, 03_random16.txt, 03_random17.txt, 03_random18.txt, 03_random19.txt, 03_random20.txt, 04_010.txt, 04_011.txt, 04_020.txt, 04_021.txt, 04_100.txt, 04_101.txt, 04_110.txt, 04_111.txt, 04_200.txt, 04_201.txt, 04_220.txt, 04_221.txt, 04_random01.txt, 04_random02.txt, 04_random03.txt, 04_random04.txt, 04_random05.txt, sample_1.txt, sample_2.txt, sample_3.txt, sample_4.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01_010.txt | AC | 16 ms | 3064 KB |
01_011.txt | AC | 17 ms | 3064 KB |
01_020.txt | AC | 17 ms | 3064 KB |
01_021.txt | AC | 16 ms | 3064 KB |
01_100.txt | AC | 16 ms | 3064 KB |
01_101.txt | AC | 18 ms | 3188 KB |
01_110.txt | AC | 16 ms | 3060 KB |
01_111.txt | AC | 17 ms | 3060 KB |
01_200.txt | AC | 17 ms | 3060 KB |
01_201.txt | AC | 17 ms | 3064 KB |
01_220.txt | AC | 22 ms | 3572 KB |
01_221.txt | AC | 18 ms | 3064 KB |
01_random01.txt | AC | 17 ms | 3060 KB |
01_random02.txt | AC | 24 ms | 3700 KB |
01_random03.txt | AC | 17 ms | 3064 KB |
01_random04.txt | AC | 23 ms | 3572 KB |
01_random05.txt | AC | 16 ms | 3064 KB |
01_random06.txt | AC | 18 ms | 3188 KB |
01_random07.txt | AC | 16 ms | 3064 KB |
01_random08.txt | AC | 22 ms | 3444 KB |
01_random09.txt | AC | 20 ms | 3316 KB |
01_random10.txt | AC | 16 ms | 3060 KB |
02_010.txt | TLE | 2117 ms | 201096 KB |
02_011.txt | TLE | 2118 ms | 225392 KB |
02_020.txt | AC | 174 ms | 17304 KB |
02_021.txt | TLE | 2117 ms | 204528 KB |
02_100.txt | TLE | 2116 ms | 197176 KB |
02_101.txt | TLE | 2117 ms | 203344 KB |
02_110.txt | AC | 17 ms | 2940 KB |
02_111.txt | TLE | 2118 ms | 232180 KB |
02_200.txt | TLE | 2118 ms | 210964 KB |
02_201.txt | TLE | 2118 ms | 225268 KB |
02_220.txt | AC | 23 ms | 3572 KB |
02_221.txt | TLE | 2119 ms | 230020 KB |
02_random01.txt | AC | 1864 ms | 167568 KB |
02_random02.txt | TLE | 2117 ms | 217768 KB |
02_random03.txt | TLE | 2118 ms | 214464 KB |
02_random04.txt | TLE | 2116 ms | 202160 KB |
02_random05.txt | TLE | 2118 ms | 210404 KB |
02_random06.txt | AC | 17 ms | 3060 KB |
02_random07.txt | TLE | 2117 ms | 211768 KB |
02_random08.txt | AC | 107 ms | 10756 KB |
02_random09.txt | TLE | 2118 ms | 225264 KB |
02_random10.txt | TLE | 2116 ms | 196624 KB |
03_010.txt | TLE | 2116 ms | 194616 KB |
03_011.txt | TLE | 2117 ms | 215544 KB |
03_012.txt | TLE | 2117 ms | 217792 KB |
03_020.txt | TLE | 2120 ms | 192388 KB |
03_021.txt | TLE | 2118 ms | 219712 KB |
03_022.txt | TLE | 2117 ms | 201908 KB |
03_100.txt | TLE | 2117 ms | 215052 KB |
03_101.txt | TLE | 2118 ms | 224876 KB |
03_102.txt | TLE | 2117 ms | 199236 KB |
03_110.txt | TLE | 2118 ms | 221624 KB |
03_111.txt | TLE | 2117 ms | 220640 KB |
03_112.txt | TLE | 2119 ms | 222080 KB |
03_200.txt | TLE | 2116 ms | 200936 KB |
03_201.txt | TLE | 2118 ms | 221652 KB |
03_202.txt | TLE | 2116 ms | 208008 KB |
03_220.txt | TLE | 2117 ms | 198352 KB |
03_221.txt | TLE | 2117 ms | 226200 KB |
03_222.txt | TLE | 2116 ms | 197600 KB |
03_random01.txt | TLE | 2118 ms | 222944 KB |
03_random02.txt | TLE | 2116 ms | 203416 KB |
03_random03.txt | TLE | 2118 ms | 228840 KB |
03_random04.txt | TLE | 2118 ms | 227880 KB |
03_random05.txt | TLE | 2117 ms | 196288 KB |
03_random06.txt | TLE | 2118 ms | 225224 KB |
03_random07.txt | TLE | 2117 ms | 215984 KB |
03_random08.txt | TLE | 2117 ms | 206856 KB |
03_random09.txt | TLE | 2118 ms | 227328 KB |
03_random10.txt | TLE | 2118 ms | 222232 KB |
03_random11.txt | TLE | 2117 ms | 201432 KB |
03_random12.txt | TLE | 2113 ms | 155672 KB |
03_random13.txt | TLE | 2117 ms | 223448 KB |
03_random14.txt | TLE | 2119 ms | 213052 KB |
03_random15.txt | TLE | 2119 ms | 238232 KB |
03_random16.txt | TLE | 2117 ms | 220148 KB |
03_random17.txt | TLE | 2117 ms | 222508 KB |
03_random18.txt | TLE | 2119 ms | 234732 KB |
03_random19.txt | TLE | 2117 ms | 208992 KB |
03_random20.txt | TLE | 2117 ms | 218520 KB |
04_010.txt | TLE | 2141 ms | 535556 KB |
04_011.txt | TLE | 2137 ms | 531464 KB |
04_020.txt | TLE | 2137 ms | 504756 KB |
04_021.txt | TLE | 2137 ms | 529252 KB |
04_100.txt | TLE | 2139 ms | 546648 KB |
04_101.txt | TLE | 2135 ms | 497108 KB |
04_110.txt | TLE | 2131 ms | 418016 KB |
04_111.txt | TLE | 2132 ms | 462928 KB |
04_200.txt | TLE | 2123 ms | 283660 KB |
04_201.txt | TLE | 2119 ms | 227596 KB |
04_220.txt | TLE | 2123 ms | 310900 KB |
04_221.txt | TLE | 2136 ms | 510528 KB |
04_random01.txt | TLE | 2120 ms | 265100 KB |
04_random02.txt | TLE | 2122 ms | 298904 KB |
04_random03.txt | TLE | 2129 ms | 400916 KB |
04_random04.txt | TLE | 2141 ms | 602136 KB |
04_random05.txt | TLE | 2128 ms | 364044 KB |
sample_1.txt | AC | 17 ms | 3060 KB |
sample_2.txt | AC | 17 ms | 3064 KB |
sample_3.txt | AC | 22 ms | 3572 KB |
sample_4.txt | TLE | 2116 ms | 194964 KB |