# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
292887 | limabeans | Power Plant (JOI20_power) | C++17 | 427 ms | 51896 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;
template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl
using ll = long long;
const ll mod = 1e9+7;
const int maxn = 200000 + 100;
// Assume answer is rooted at node and join the children, test all nodes via re-rooting trick.
// Key observation: a node's contribution upwards is either itself, or disjoint children in it's subtrees.
int n;
vector<int> g[maxn];
string s;
struct vec {
multiset<int> ms;
int tot=0;
void insert(int x) {
ms.insert(x);
tot += x;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |