# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
70177 | model_code | Cloud Computing (CEOI18_clo) | C++17 | 2436 ms | 5800 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.
// Kamil Debowski
// OBL, AC solution
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
vector<pair<int, pair<int,int>>> events;
for(int rep = 0; rep < 2; ++rep) {
int n;
scanf("%d", &n);
while(n--) {
int cnt, freq, cost;
scanf("%d%d%d", &cnt, &freq, &cost);
if(rep == 0) {
cost *= -1; // cost of CPU
}
else {
cnt *= -1;
}
// otherwise gain from a task
events.push_back({freq, {cnt, cost}});
}
}
sort(events.rbegin(), events.rend());
vector<ll> dp{0};
for(int i = 0; i < (int) events.size(); ++i) {
vector<ll> dp2 = dp;
for(int cnt = 0; cnt < (int) dp.size(); ++cnt) {
int cnt2 = cnt + events[i].second.first;
ll maybe_cost = dp[cnt] + events[i].second.second;
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... |