# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1095147 | SalihSahin | Jobs (BOI24_jobs) | C++14 | 166 ms | 79696 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>
#define pb push_back
#define int long long
using namespace std;
const int N = 3e5 + 5;
const int K = 20;
const int mod = 1e9 + 7;
vector<int> adj[N], x(N), p(N), gett(N);
vector<int> radj[N], lstadj[N];
void calc(int node, int lastpar){
if(x[node] >= 0){
gett[lastpar] += x[node];
for(auto itr: adj[node]){
calc(itr, lastpar);
}
}
else{
radj[lastpar].pb(node);
for(auto itr: adj[node]){
calc(itr, node);
}
}
}
void make_good(int node){
for(auto itr: radj[node]){
make_good(itr);
# | 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... |