# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
954492 | Skywk | Magic Tree (CEOI19_magictree) | C++17 | 102 ms | 38484 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 1e5;
struct Tree{
vector<int> adj[MAXN + 1];
int ds[MAXN + 1], js[MAXN + 1];
void insert(map<int, long long>* dp, int v){
(*dp)[ds[v]] += js[v];
auto ptr = dp->find(ds[v]);
int j_left = js[v];
while(j_left > 0 && next(ptr) != dp->end()){
auto nxt_ptr = next(ptr);
if(nxt_ptr->second > j_left){
nxt_ptr->second -= j_left;
break;
}
else{
j_left -= nxt_ptr->second;
dp->erase(nxt_ptr);
}
}
}
map<int, long long>* TreeDp(int v){
auto curr_map = new map<int, long long>();
for(auto u : adj[v]){
auto new_map = TreeDp(u);
if(new_map->size() > curr_map->size()) swap(curr_map, new_map);
for(auto [key, value] : *new_map){
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |