| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 447557 | SirCovidThe19th | Cloud Computing (CEOI18_clo) | C++14 | 743 ms | 1988 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, x, y) for (int i = x; i < y; i++)
#define mx (int)1e5
#define ll long long
struct CP{ int c, f, v; };
int main(){
int n, m; CP A[4005]; array<ll, mx> dp;
cin >> n; FOR(i, 0, n) cin >> A[i].c >> A[i].f >> A[i].v, A[i].v *= -1;
cin >> m; FOR(i, n, m+n) cin >> A[i].c >> A[i].f >> A[i].v, A[i].c *= -1;
sort(A, A+n+m, [](CP a, CP b){ return a.f > b.f; } );
dp.fill(-1e18); dp[0] = 0;
FOR(i, 0, m+n){
array<ll, mx> DP;
FOR(j, 0, mx){
DP[j] = dp[j]; if (j-A[i].c < 0 or j-A[i].c >= mx) continue;
DP[j] = max(DP[j], dp[j-A[i].c]+A[i].v);
}dp = DP;
}cout<<*max_element(dp.begin(), dp.end())<<endl;
}
| # | 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... | ||||
