# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
757560 | 1bin | Jelly Flavours (IOI20_jelly) | C++14 | 133 ms | 156940 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "jelly.h"
using namespace std;
#define all(v) v.begin(), v.end()
typedef long long ll;
const int NMAX = 1e6 + 5;
int dp[2003][10004], dp2[2003][10004];
vector<pair<int, int>> v;
int find_maximum_unique(int Amx, int Bmx, vector<int> a, vector<int> b) {
int n = a.size(), ans = 0;
for(int i = 0; i < n; i++) v.emplace_back(a[i], b[i]);
sort(all(v));
for(int i = 1; i <= n; i++){
auto&[a, b] = v[i - 1];
for(int j = Amx; j >= a; j--) dp[i][j] = min(dp[i - 1][j] + b, dp[i - 1][j - a]);
for(int j = a - 1; j >= 0; j--) dp[i][j] = dp[i - 1][j] + b;
if(dp[i][Amx] <= Bmx) ans = i;
}
for(int i = n; i; i--){
auto&[a, b] = v[i - 1];
for(int j = Bmx; j >= 0; j--){
dp2[i][j] = dp2[i + 1][j];
if(j >= b) dp2[i][j] = max(dp2[i][j], dp2[i + 1][j - b] + 1);
}
if(dp[i - 1][Amx] <= Bmx) ans = max(ans, i - 1 + dp2[i][Bmx - dp[i - 1][Amx]]);
}
return ans;
}
컴파일 시 표준 에러 (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... |