# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
483229 | Monarchuwu | Cloud Computing (CEOI18_clo) | C++17 | 250 ms | 1356 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.
/**
* - xét: f[i] = F[j] = 1
* => build 2 knap:
* + dp1[x]: mincost để mua được x cores
* + dp2[y]: max profit khi bán được y cores
* + ans = max(dp2[y] - dp1[x]) (x >= y)
* + cùng đơn vị core => ta sửa đổi lại lại một chút nhằm hợp lại còn 1 knap:
* + machine : c[i] cores và -v[i] value
* + order : -C[i] cores và V[i] value
* => knap max profit = max dp[i] (i >= 0)
*
* - xét: f, F bất kì
* => ta sort f, F (sort chung) giảm dần và build 1 knap dp[j] là max profit khi còn trữ j cores (j >= 0) (xét i ptu đầu)
*
* - x = n + m
* - đpt: O(xlogx + x * (n * c))
**/
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
typedef long long ll;
const int N = 2000 + 3, NC = N * 50;
int n, m;
struct Data {
int c, f, v;
bool operator < (Data o) const {
if (f != o.f) return f > o.f;
if (c != o.c) return c > o.c;
return v > o.v;
# | 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... |