# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
316280 | lauran | Jelly Flavours (IOI20_jelly) | C++14 | 2089 ms | 413048 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int dp[205][505][505];
int find_maximum_unique(int x, int y, vector <int> a, vector <int> b) {
int n = a.size();
if (x <= 500 && y <= 500 && n <= 200) {
// subtask 1, 2
//int dp[n + 10][x + 10][y + 10] = {0};
for (int i = 1; i <= n; i++) {
for (int xx = 0; xx <= x; xx++) {
for (int yy = 0; yy <= y; yy++) {
dp[i][xx][yy] = dp[i - 1][xx][yy];
if (xx >= a[i - 1])
dp[i][xx][yy] = max(dp[i][xx][yy], dp[i - 1][xx - a[i - 1]][yy] + 1);
if (yy >= b[i - 1])
dp[i][xx][yy] = max(dp[i][xx][yy], dp[i - 1][xx][yy - b[i - 1]] + 1);
}
}
}
int ans = dp[n][0][0];
for (int xx = 0; xx <= x; xx++)
for (int yy = 0; yy <= y; yy++)
ans = max(ans, dp[n][xx][yy]);
return ans;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |