# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
417262 | lyc | Worst Reporter 4 (JOI21_worst_reporter4) | C++14 | 133 ms | 1484 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.
#include <bits/stdc++.h>
using namespace std;
#define TRACE(x) cerr << #x << " :: " << x << endl
#define _ << " " <<
#define SZ(x) (int)(x).size()
#define ALL(x) (x).begin(),(x).end()
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define RFOR(i,a,b) for(int i=(a);i>=(b);--i)
typedef long long ll;
//const int mxN = 2e5+5;
const int mxN = 5e3+5;
const ll inf = 1e18;
int N, A[mxN], H[mxN], C[mxN];
vector<int> al[mxN];
ll dp[mxN], sum[mxN];
ll best(int u, int x) {
ll ret = 0;
for (int v : al[u]) {
ret += best(v,x);
}
if (H[x] <= H[u]) {
ret = min(ret, dp[u]-sum[u]);
}
return ret;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |