# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1010331 | AdamGS | Worst Reporter 4 (JOI21_worst_reporter4) | C++17 | 217 ms | 58688 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;
typedef long double ld;
typedef long long ll;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
const int LIM=2e5+7;
vector<int>V[LIM];
ll A[LIM], T[LIM], C[LIM], odw[LIM], cykl[LIM], root[LIM], ile[LIM];
void DFS(int x) {
ile[x]=1;
for(auto i : V[x]) {
DFS(i);
ile[x]+=ile[i];
}
rep(i, V[x].size()) if(ile[V[x][i]]>ile[V[x][0]]) swap(V[x][i], V[x][0]);
}
void DFS2(int x, multiset<pair<ll,ll>>&S) {
if(V[x].size()) DFS2(V[x][0], S);
for(int i=1; i<V[x].size(); ++i) {
multiset<pair<ll,ll>>P;
DFS2(V[x][i], P);
for(auto j : P) S.insert(j);
}
ll a=C[x];
while(a) {
auto it=S.lower_bound({T[x], -1});
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... |