# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
392747 | phathnv | Jelly Flavours (IOI20_jelly) | C++14 | 199 ms | 154696 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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;
sort(ind.begin(), ind.end(), [&](const int &x, const int &y){
return b[x] < b[y];
});
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;
}
컴파일 시 표준 에러 (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... |