# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
991897 | crafticat | Cloud Computing (CEOI18_clo) | C++17 | 923 ms | 2256 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using tup = tuple<ll,ll,ll>;
ll n, q;
ll MAX_SUM = 0;
constexpr ll inf = 1e18;
vector<ll> solve(vector<tup> &data, bool mex) {
vector<ll> dp(vector<ll>(MAX_SUM + 1,mex ? -inf : inf));
dp[0] = 0;
for (ll i = 1; i <= data.size() ; ++i) {
vector<ll> newDp = dp;
auto [f,c, v] = data[i - 1];
for (ll j = 0; j <= MAX_SUM; ++j) {
if (mex) {
if (j - c >= 0 && j - c <= MAX_SUM) newDp[j] = max(dp[j],dp[j - c] + v);
} else {
if (j - c >= 0 && j - c <= MAX_SUM) newDp[j] = min(dp[j],dp[j - c] + v);
}
}
dp = newDp;
}
return dp;
}
컴파일 시 표준 에러 (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... |