Submission #4034923
Source Code Expand
n,k = map(int,input().split()) a = list(map(int,input().split())) dp = [set() for i in range(n)] dp2 = [float("inf")]*n matome = set() matome.add(0) for i in range(n): for j in list(matome): if j + a[i] >= k: dp2[i] = min(dp2[i],j+a[i]) else: dp[i].add(j+a[i]) matome.add(j+a[i]) for j in range(i-1): for l in list(dp[j]): if l + a[i] >= k: dp2[j] = min(dp2[j],l+a[i]) else: dp[j].add(l+a[i]) matome.add(l+a[i]) ans = 0 for i in range(n): if dp2[i] - a[i] >= k: ans += 1 print(ans)
Submission Info
Submission Time | |
---|---|
Task | D - No Need |
User | rookzeno |
Language | PyPy3 (2.4.0) |
Score | 0 |
Code Size | 584 Byte |
Status | WA |
Exec Time | 2108 ms |
Memory | 80220 KB |
Judge Result
Set Name | Sample | Subtask | All | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | 0 / 300 | ||||||||||||||
Status |
|
|
|
Set Name | Test Cases |
---|---|
Sample | 0_000.txt, 0_001.txt, 0_002.txt |
Subtask | 0_000.txt, 0_001.txt, 0_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt, 1_011.txt, 1_012.txt, 1_013.txt, 1_014.txt, 1_015.txt, 1_016.txt, 1_017.txt, 1_018.txt, 1_019.txt, 1_020.txt, 1_021.txt, 1_022.txt, 1_023.txt, 1_024.txt, 1_025.txt |
All | 0_000.txt, 0_001.txt, 0_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt, 1_011.txt, 1_012.txt, 1_013.txt, 1_014.txt, 1_015.txt, 1_016.txt, 1_017.txt, 1_018.txt, 1_019.txt, 1_020.txt, 1_021.txt, 1_022.txt, 1_023.txt, 1_024.txt, 1_025.txt, 2_026.txt, 2_027.txt, 2_028.txt, 2_029.txt, 2_030.txt, 2_031.txt, 2_032.txt, 2_033.txt, 2_034.txt, 2_035.txt, 2_036.txt, 2_037.txt, 2_038.txt, 2_039.txt, 2_040.txt, 2_041.txt, 2_042.txt, 2_043.txt, 2_044.txt, 2_045.txt, 2_046.txt, 2_047.txt, 2_048.txt, 2_049.txt, 2_050.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_000.txt | WA | 172 ms | 38256 KB |
0_001.txt | AC | 172 ms | 38256 KB |
0_002.txt | AC | 172 ms | 38384 KB |
1_003.txt | AC | 170 ms | 38256 KB |
1_004.txt | AC | 166 ms | 38256 KB |
1_005.txt | AC | 167 ms | 38256 KB |
1_006.txt | AC | 170 ms | 38768 KB |
1_007.txt | WA | 173 ms | 38768 KB |
1_008.txt | WA | 903 ms | 56796 KB |
1_009.txt | AC | 897 ms | 56668 KB |
1_010.txt | AC | 189 ms | 40812 KB |
1_011.txt | AC | 189 ms | 40812 KB |
1_012.txt | AC | 190 ms | 40940 KB |
1_013.txt | AC | 187 ms | 40812 KB |
1_014.txt | AC | 189 ms | 40940 KB |
1_015.txt | AC | 596 ms | 46940 KB |
1_016.txt | AC | 166 ms | 38256 KB |
1_017.txt | WA | 168 ms | 38256 KB |
1_018.txt | AC | 170 ms | 38256 KB |
1_019.txt | AC | 210 ms | 41712 KB |
1_020.txt | AC | 235 ms | 43356 KB |
1_021.txt | AC | 436 ms | 44508 KB |
1_022.txt | AC | 260 ms | 43356 KB |
1_023.txt | AC | 216 ms | 42716 KB |
1_024.txt | AC | 394 ms | 45148 KB |
1_025.txt | AC | 447 ms | 44252 KB |
2_026.txt | AC | 179 ms | 38256 KB |
2_027.txt | AC | 185 ms | 40048 KB |
2_028.txt | WA | 184 ms | 40048 KB |
2_029.txt | TLE | 2107 ms | 62684 KB |
2_030.txt | TLE | 2107 ms | 62940 KB |
2_031.txt | AC | 725 ms | 41964 KB |
2_032.txt | AC | 736 ms | 41964 KB |
2_033.txt | AC | 738 ms | 41836 KB |
2_034.txt | AC | 750 ms | 41836 KB |
2_035.txt | AC | 729 ms | 41836 KB |
2_036.txt | TLE | 2108 ms | 76764 KB |
2_037.txt | AC | 175 ms | 39152 KB |
2_038.txt | WA | 177 ms | 39152 KB |
2_039.txt | AC | 182 ms | 39152 KB |
2_040.txt | AC | 1184 ms | 48476 KB |
2_041.txt | TLE | 2108 ms | 74716 KB |
2_042.txt | TLE | 2108 ms | 80220 KB |
2_043.txt | TLE | 2107 ms | 66524 KB |
2_044.txt | TLE | 2108 ms | 69980 KB |
2_045.txt | TLE | 2107 ms | 69252 KB |
2_046.txt | TLE | 2107 ms | 63964 KB |
2_047.txt | TLE | 2107 ms | 60124 KB |
2_048.txt | TLE | 2107 ms | 58844 KB |
2_049.txt | TLE | 2106 ms | 58312 KB |
2_050.txt | TLE | 2107 ms | 57052 KB |