# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
427525 | 2021-06-14T16:29:42 Z | lakshith_ | Jelly Flavours (IOI20_jelly) | C++14 | 276 ms | 152644 KB |
#include <bits/stdc++.h> #include "jelly.h" using namespace std; int find_maximum_unique(int x, int y, vector<int> a, vector<int> b){ int n = a.size(); vector<int> ind(n); for(int i = 0; i < n; i++) ind[i] = i; pair<int, int> dp[n + 1][x + 1]; for(int i = 0; i <= n; i++) for(int j = 0; j <= x; j++) dp[i][j] = {0, 0}; dp[0][x] = {0, y}; for(int i = 0; i < n; i++) for(int j = 0; j <= x; j++){ if (j >= a[ind[i]]) dp[i + 1][j - a[ind[i]]] = max(dp[i + 1][j - a[ind[i]]], {dp[i][j].first + 1, dp[i][j].second}); if (dp[i][j].second >= b[ind[i]]) dp[i + 1][j] = max(dp[i + 1][j], {dp[i][j].first + 1, dp[i][j].second - b[ind[i]]}); dp[i + 1][j] = max(dp[i + 1][j], dp[i][j]); } int res = 0; for(int j = 0; j <= x; j++) res = max(res, dp[n][j].first); return res; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 332 KB | Output is correct |
2 | Correct | 1 ms | 292 KB | Output is correct |
3 | Correct | 1 ms | 332 KB | Output is correct |
4 | Correct | 1 ms | 296 KB | Output is correct |
5 | Correct | 1 ms | 292 KB | Output is correct |
6 | Incorrect | 1 ms | 288 KB | 1st lines differ - on the 1st token, expected: '6', found: '5' |
7 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 332 KB | Output is correct |
2 | Correct | 1 ms | 292 KB | Output is correct |
3 | Correct | 1 ms | 332 KB | Output is correct |
4 | Correct | 1 ms | 296 KB | Output is correct |
5 | Correct | 1 ms | 292 KB | Output is correct |
6 | Incorrect | 1 ms | 288 KB | 1st lines differ - on the 1st token, expected: '6', found: '5' |
7 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 38 ms | 26324 KB | Output is correct |
2 | Correct | 57 ms | 40732 KB | Output is correct |
3 | Correct | 16 ms | 10900 KB | Output is correct |
4 | Correct | 27 ms | 16180 KB | Output is correct |
5 | Correct | 170 ms | 106904 KB | Output is correct |
6 | Correct | 204 ms | 135748 KB | Output is correct |
7 | Correct | 188 ms | 131268 KB | Output is correct |
8 | Correct | 37 ms | 25420 KB | Output is correct |
9 | Correct | 250 ms | 139512 KB | Output is correct |
10 | Correct | 90 ms | 57124 KB | Output is correct |
11 | Correct | 178 ms | 122368 KB | Output is correct |
12 | Correct | 142 ms | 96400 KB | Output is correct |
13 | Correct | 125 ms | 84064 KB | Output is correct |
14 | Correct | 43 ms | 26860 KB | Output is correct |
15 | Correct | 154 ms | 96944 KB | Output is correct |
16 | Correct | 140 ms | 92440 KB | Output is correct |
17 | Correct | 147 ms | 97768 KB | Output is correct |
18 | Correct | 150 ms | 104920 KB | Output is correct |
19 | Correct | 133 ms | 82804 KB | Output is correct |
20 | Correct | 43 ms | 26572 KB | Output is correct |
21 | Correct | 38 ms | 26280 KB | Output is correct |
22 | Correct | 58 ms | 40760 KB | Output is correct |
23 | Correct | 16 ms | 10828 KB | Output is correct |
24 | Correct | 26 ms | 16184 KB | Output is correct |
25 | Correct | 176 ms | 106980 KB | Output is correct |
26 | Correct | 205 ms | 135748 KB | Output is correct |
27 | Correct | 196 ms | 131288 KB | Output is correct |
28 | Correct | 37 ms | 25420 KB | Output is correct |
29 | Correct | 218 ms | 139444 KB | Output is correct |
30 | Correct | 90 ms | 57120 KB | Output is correct |
31 | Correct | 177 ms | 122256 KB | Output is correct |
32 | Correct | 137 ms | 96344 KB | Output is correct |
33 | Correct | 123 ms | 83988 KB | Output is correct |
34 | Correct | 44 ms | 26828 KB | Output is correct |
35 | Correct | 162 ms | 97028 KB | Output is correct |
36 | Correct | 131 ms | 92228 KB | Output is correct |
37 | Correct | 138 ms | 97768 KB | Output is correct |
38 | Correct | 149 ms | 105028 KB | Output is correct |
39 | Correct | 135 ms | 82848 KB | Output is correct |
40 | Correct | 43 ms | 26472 KB | Output is correct |
41 | Correct | 38 ms | 26192 KB | Output is correct |
42 | Correct | 57 ms | 40780 KB | Output is correct |
43 | Correct | 19 ms | 10936 KB | Output is correct |
44 | Correct | 27 ms | 16180 KB | Output is correct |
45 | Correct | 169 ms | 106900 KB | Output is correct |
46 | Correct | 197 ms | 135748 KB | Output is correct |
47 | Correct | 202 ms | 131380 KB | Output is correct |
48 | Correct | 37 ms | 25420 KB | Output is correct |
49 | Correct | 227 ms | 139512 KB | Output is correct |
50 | Correct | 93 ms | 57116 KB | Output is correct |
51 | Correct | 178 ms | 122372 KB | Output is correct |
52 | Correct | 144 ms | 96352 KB | Output is correct |
53 | Correct | 123 ms | 84036 KB | Output is correct |
54 | Correct | 55 ms | 26856 KB | Output is correct |
55 | Correct | 161 ms | 97028 KB | Output is correct |
56 | Correct | 132 ms | 92236 KB | Output is correct |
57 | Correct | 153 ms | 97768 KB | Output is correct |
58 | Correct | 151 ms | 104992 KB | Output is correct |
59 | Correct | 142 ms | 82852 KB | Output is correct |
60 | Correct | 53 ms | 26548 KB | Output is correct |
61 | Correct | 39 ms | 26288 KB | Output is correct |
62 | Correct | 58 ms | 40780 KB | Output is correct |
63 | Correct | 19 ms | 10908 KB | Output is correct |
64 | Correct | 27 ms | 16188 KB | Output is correct |
65 | Correct | 169 ms | 106900 KB | Output is correct |
66 | Correct | 200 ms | 135780 KB | Output is correct |
67 | Correct | 196 ms | 131380 KB | Output is correct |
68 | Correct | 37 ms | 25420 KB | Output is correct |
69 | Correct | 223 ms | 139444 KB | Output is correct |
70 | Correct | 90 ms | 57120 KB | Output is correct |
71 | Correct | 184 ms | 122436 KB | Output is correct |
72 | Correct | 136 ms | 96352 KB | Output is correct |
73 | Correct | 131 ms | 84036 KB | Output is correct |
74 | Correct | 43 ms | 26876 KB | Output is correct |
75 | Correct | 156 ms | 97092 KB | Output is correct |
76 | Correct | 138 ms | 92340 KB | Output is correct |
77 | Correct | 160 ms | 97732 KB | Output is correct |
78 | Correct | 154 ms | 105064 KB | Output is correct |
79 | Correct | 132 ms | 82820 KB | Output is correct |
80 | Correct | 44 ms | 26564 KB | Output is correct |
81 | Correct | 38 ms | 26268 KB | Output is correct |
82 | Correct | 62 ms | 40772 KB | Output is correct |
83 | Correct | 18 ms | 10828 KB | Output is correct |
84 | Correct | 26 ms | 16076 KB | Output is correct |
85 | Correct | 169 ms | 106884 KB | Output is correct |
86 | Correct | 221 ms | 135888 KB | Output is correct |
87 | Correct | 187 ms | 131352 KB | Output is correct |
88 | Correct | 40 ms | 25420 KB | Output is correct |
89 | Correct | 221 ms | 139460 KB | Output is correct |
90 | Correct | 91 ms | 57124 KB | Output is correct |
91 | Correct | 171 ms | 122328 KB | Output is correct |
92 | Correct | 146 ms | 96316 KB | Output is correct |
93 | Correct | 121 ms | 84044 KB | Output is correct |
94 | Correct | 44 ms | 26984 KB | Output is correct |
95 | Correct | 159 ms | 97028 KB | Output is correct |
96 | Correct | 135 ms | 92356 KB | Output is correct |
97 | Correct | 139 ms | 97764 KB | Output is correct |
98 | Correct | 152 ms | 105028 KB | Output is correct |
99 | Correct | 131 ms | 82816 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 199 ms | 141996 KB | Output is correct |
2 | Correct | 197 ms | 142584 KB | Output is correct |
3 | Correct | 212 ms | 148852 KB | Output is correct |
4 | Correct | 264 ms | 149444 KB | Output is correct |
5 | Correct | 267 ms | 151716 KB | Output is correct |
6 | Correct | 201 ms | 142944 KB | Output is correct |
7 | Correct | 203 ms | 142276 KB | Output is correct |
8 | Correct | 206 ms | 149272 KB | Output is correct |
9 | Correct | 269 ms | 148164 KB | Output is correct |
10 | Correct | 260 ms | 143944 KB | Output is correct |
11 | Correct | 14 ms | 8524 KB | Output is correct |
12 | Correct | 1 ms | 332 KB | Output is correct |
13 | Correct | 4 ms | 2892 KB | Output is correct |
14 | Correct | 6 ms | 3148 KB | Output is correct |
15 | Correct | 14 ms | 8144 KB | Output is correct |
16 | Correct | 3 ms | 1612 KB | Output is correct |
17 | Correct | 202 ms | 144872 KB | Output is correct |
18 | Correct | 193 ms | 141508 KB | Output is correct |
19 | Correct | 250 ms | 152548 KB | Output is correct |
20 | Correct | 234 ms | 138912 KB | Output is correct |
21 | Correct | 220 ms | 142192 KB | Output is correct |
22 | Correct | 201 ms | 142604 KB | Output is correct |
23 | Correct | 210 ms | 148828 KB | Output is correct |
24 | Correct | 263 ms | 149184 KB | Output is correct |
25 | Correct | 264 ms | 151616 KB | Output is correct |
26 | Correct | 202 ms | 142796 KB | Output is correct |
27 | Correct | 196 ms | 142388 KB | Output is correct |
28 | Correct | 215 ms | 149224 KB | Output is correct |
29 | Correct | 254 ms | 148276 KB | Output is correct |
30 | Correct | 242 ms | 143944 KB | Output is correct |
31 | Correct | 12 ms | 8480 KB | Output is correct |
32 | Correct | 1 ms | 332 KB | Output is correct |
33 | Correct | 5 ms | 2868 KB | Output is correct |
34 | Correct | 6 ms | 3148 KB | Output is correct |
35 | Correct | 14 ms | 8184 KB | Output is correct |
36 | Correct | 3 ms | 1612 KB | Output is correct |
37 | Correct | 198 ms | 144836 KB | Output is correct |
38 | Correct | 198 ms | 141516 KB | Output is correct |
39 | Correct | 255 ms | 152548 KB | Output is correct |
40 | Correct | 223 ms | 138948 KB | Output is correct |
41 | Correct | 193 ms | 141980 KB | Output is correct |
42 | Correct | 196 ms | 142660 KB | Output is correct |
43 | Correct | 214 ms | 148764 KB | Output is correct |
44 | Correct | 257 ms | 149256 KB | Output is correct |
45 | Correct | 261 ms | 151732 KB | Output is correct |
46 | Correct | 206 ms | 142916 KB | Output is correct |
47 | Correct | 202 ms | 142504 KB | Output is correct |
48 | Correct | 240 ms | 149336 KB | Output is correct |
49 | Correct | 258 ms | 148228 KB | Output is correct |
50 | Correct | 276 ms | 143900 KB | Output is correct |
51 | Correct | 12 ms | 8524 KB | Output is correct |
52 | Correct | 1 ms | 332 KB | Output is correct |
53 | Correct | 4 ms | 2892 KB | Output is correct |
54 | Correct | 6 ms | 3148 KB | Output is correct |
55 | Correct | 18 ms | 8108 KB | Output is correct |
56 | Correct | 3 ms | 1612 KB | Output is correct |
57 | Correct | 206 ms | 144800 KB | Output is correct |
58 | Correct | 210 ms | 141608 KB | Output is correct |
59 | Correct | 246 ms | 152516 KB | Output is correct |
60 | Correct | 220 ms | 138892 KB | Output is correct |
61 | Correct | 229 ms | 142020 KB | Output is correct |
62 | Correct | 196 ms | 142532 KB | Output is correct |
63 | Correct | 207 ms | 148852 KB | Output is correct |
64 | Correct | 274 ms | 149184 KB | Output is correct |
65 | Correct | 259 ms | 151716 KB | Output is correct |
66 | Correct | 197 ms | 142868 KB | Output is correct |
67 | Correct | 207 ms | 142360 KB | Output is correct |
68 | Correct | 203 ms | 149340 KB | Output is correct |
69 | Correct | 256 ms | 148156 KB | Output is correct |
70 | Correct | 244 ms | 143824 KB | Output is correct |
71 | Correct | 12 ms | 8524 KB | Output is correct |
72 | Correct | 1 ms | 332 KB | Output is correct |
73 | Correct | 4 ms | 2892 KB | Output is correct |
74 | Correct | 8 ms | 3276 KB | Output is correct |
75 | Correct | 14 ms | 8140 KB | Output is correct |
76 | Correct | 3 ms | 1612 KB | Output is correct |
77 | Correct | 204 ms | 144904 KB | Output is correct |
78 | Correct | 202 ms | 141564 KB | Output is correct |
79 | Correct | 258 ms | 152644 KB | Output is correct |
80 | Correct | 219 ms | 138896 KB | Output is correct |
81 | Correct | 202 ms | 142100 KB | Output is correct |
82 | Correct | 196 ms | 142508 KB | Output is correct |
83 | Correct | 206 ms | 148796 KB | Output is correct |
84 | Correct | 261 ms | 149188 KB | Output is correct |
85 | Correct | 262 ms | 151716 KB | Output is correct |
86 | Correct | 204 ms | 142744 KB | Output is correct |
87 | Correct | 199 ms | 142408 KB | Output is correct |
88 | Correct | 216 ms | 149332 KB | Output is correct |
89 | Correct | 262 ms | 148220 KB | Output is correct |
90 | Correct | 244 ms | 143792 KB | Output is correct |
91 | Correct | 12 ms | 8524 KB | Output is correct |
92 | Correct | 1 ms | 332 KB | Output is correct |
93 | Correct | 5 ms | 2892 KB | Output is correct |
94 | Correct | 6 ms | 3148 KB | Output is correct |
95 | Correct | 14 ms | 8140 KB | Output is correct |
96 | Correct | 3 ms | 1588 KB | Output is correct |
97 | Correct | 201 ms | 144884 KB | Output is correct |
98 | Correct | 198 ms | 141508 KB | Output is correct |
99 | Correct | 251 ms | 152544 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 229 ms | 141892 KB | 1st lines differ - on the 1st token, expected: '154', found: '147' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 332 KB | Output is correct |
2 | Correct | 1 ms | 292 KB | Output is correct |
3 | Correct | 1 ms | 332 KB | Output is correct |
4 | Correct | 1 ms | 296 KB | Output is correct |
5 | Correct | 1 ms | 292 KB | Output is correct |
6 | Incorrect | 1 ms | 288 KB | 1st lines differ - on the 1st token, expected: '6', found: '5' |
7 | Halted | 0 ms | 0 KB | - |