#include "jelly.h"
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 205, MAX = 505;
int dp[MAXN][MAX][MAX];
int find_maximum_unique(int x, int y, vector<int> a, vector<int> b) {
int n = a.size();
for(int i = n; i >= 1; i--)
for(int j = 1; j <= x; j++)
for(int k = 1; k <= y; k++){
dp[i][j][k] = dp[i+1][j][k];
if(j >= a[i-1])dp[i][j][k] = max(dp[i][j][k], dp[i+1][j-a[i-1]][k]+1);
if(k >= b[i-1])dp[i][j][k] = max(dp[i][j][k], dp[i+1][j][k-b[i-1]]+1);
}
return dp[1][x][y];
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
10072 KB |
Output is correct |
2 |
Correct |
5 ms |
11048 KB |
Output is correct |
3 |
Correct |
5 ms |
9820 KB |
Output is correct |
4 |
Correct |
8 ms |
13112 KB |
Output is correct |
5 |
Correct |
7 ms |
10172 KB |
Output is correct |
6 |
Correct |
5 ms |
9052 KB |
Output is correct |
7 |
Correct |
6 ms |
11864 KB |
Output is correct |
8 |
Correct |
4 ms |
9052 KB |
Output is correct |
9 |
Correct |
7 ms |
11100 KB |
Output is correct |
10 |
Correct |
8 ms |
12892 KB |
Output is correct |
11 |
Correct |
2 ms |
9052 KB |
Output is correct |
12 |
Correct |
3 ms |
10076 KB |
Output is correct |
13 |
Correct |
5 ms |
10844 KB |
Output is correct |
14 |
Correct |
5 ms |
9820 KB |
Output is correct |
15 |
Correct |
8 ms |
12892 KB |
Output is correct |
16 |
Correct |
6 ms |
10176 KB |
Output is correct |
17 |
Correct |
4 ms |
9048 KB |
Output is correct |
18 |
Correct |
7 ms |
11868 KB |
Output is correct |
19 |
Correct |
4 ms |
9152 KB |
Output is correct |
20 |
Correct |
6 ms |
11100 KB |
Output is correct |
21 |
Correct |
2 ms |
10844 KB |
Output is correct |
22 |
Correct |
8 ms |
12892 KB |
Output is correct |
23 |
Correct |
2 ms |
10840 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Incorrect |
2 ms |
10588 KB |
1st lines differ - on the 1st token, expected: '8', found: '7' |
26 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
10072 KB |
Output is correct |
2 |
Correct |
5 ms |
11048 KB |
Output is correct |
3 |
Correct |
5 ms |
9820 KB |
Output is correct |
4 |
Correct |
8 ms |
13112 KB |
Output is correct |
5 |
Correct |
7 ms |
10172 KB |
Output is correct |
6 |
Correct |
5 ms |
9052 KB |
Output is correct |
7 |
Correct |
6 ms |
11864 KB |
Output is correct |
8 |
Correct |
4 ms |
9052 KB |
Output is correct |
9 |
Correct |
7 ms |
11100 KB |
Output is correct |
10 |
Correct |
8 ms |
12892 KB |
Output is correct |
11 |
Correct |
2 ms |
9052 KB |
Output is correct |
12 |
Correct |
3 ms |
10076 KB |
Output is correct |
13 |
Correct |
5 ms |
10844 KB |
Output is correct |
14 |
Correct |
5 ms |
9820 KB |
Output is correct |
15 |
Correct |
8 ms |
12892 KB |
Output is correct |
16 |
Correct |
6 ms |
10176 KB |
Output is correct |
17 |
Correct |
4 ms |
9048 KB |
Output is correct |
18 |
Correct |
7 ms |
11868 KB |
Output is correct |
19 |
Correct |
4 ms |
9152 KB |
Output is correct |
20 |
Correct |
6 ms |
11100 KB |
Output is correct |
21 |
Correct |
2 ms |
10844 KB |
Output is correct |
22 |
Correct |
8 ms |
12892 KB |
Output is correct |
23 |
Correct |
2 ms |
10840 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Incorrect |
2 ms |
10588 KB |
1st lines differ - on the 1st token, expected: '8', found: '7' |
26 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
348 KB |
1st lines differ - on the 1st token, expected: '689', found: '0' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
5 ms |
604 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
5 ms |
604 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
10072 KB |
Output is correct |
2 |
Correct |
5 ms |
11048 KB |
Output is correct |
3 |
Correct |
5 ms |
9820 KB |
Output is correct |
4 |
Correct |
8 ms |
13112 KB |
Output is correct |
5 |
Correct |
7 ms |
10172 KB |
Output is correct |
6 |
Correct |
5 ms |
9052 KB |
Output is correct |
7 |
Correct |
6 ms |
11864 KB |
Output is correct |
8 |
Correct |
4 ms |
9052 KB |
Output is correct |
9 |
Correct |
7 ms |
11100 KB |
Output is correct |
10 |
Correct |
8 ms |
12892 KB |
Output is correct |
11 |
Correct |
2 ms |
9052 KB |
Output is correct |
12 |
Correct |
3 ms |
10076 KB |
Output is correct |
13 |
Correct |
5 ms |
10844 KB |
Output is correct |
14 |
Correct |
5 ms |
9820 KB |
Output is correct |
15 |
Correct |
8 ms |
12892 KB |
Output is correct |
16 |
Correct |
6 ms |
10176 KB |
Output is correct |
17 |
Correct |
4 ms |
9048 KB |
Output is correct |
18 |
Correct |
7 ms |
11868 KB |
Output is correct |
19 |
Correct |
4 ms |
9152 KB |
Output is correct |
20 |
Correct |
6 ms |
11100 KB |
Output is correct |
21 |
Correct |
2 ms |
10844 KB |
Output is correct |
22 |
Correct |
8 ms |
12892 KB |
Output is correct |
23 |
Correct |
2 ms |
10840 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Incorrect |
2 ms |
10588 KB |
1st lines differ - on the 1st token, expected: '8', found: '7' |
26 |
Halted |
0 ms |
0 KB |
- |