# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
254011 | Nightlight | Tax Evasion (LMIO19_mokesciai) | C++14 | 583 ms | 42348 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int N, M;
vector<int> adj[200005];
priority_queue<int, vector<int>> pq[200005];
int need[200005], can[200005], depth[200005];
bitset<200005> coin;
void DFS(int u, int p) {
depth[u] = depth[p] + 1;
for(int v : adj[u]) {
if(v == p) continue;
DFS(v, u);
if(pq[v].size() > pq[u].size()) swap(pq[u], pq[v]);
need[u] += need[v];
}
for(int v : adj[u]) {
if(v == p) continue;
while(!pq[v].empty()) pq[u].emplace(pq[v].top()), pq[v].pop();
}
if(coin[u]) pq[u].emplace(depth[u] / 2 + (depth[u] & 1));
while(!pq[u].empty() && pq[u].top() == depth[u]) {
need[u]++;
pq[u].pop();
}
// cout << u << " " << need[u] << "\n";
}
int l, r, mid, ans;
# | 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... |