# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
834763 | FEDIKUS | Fireworks (APIO16_fireworks) | C++17 | 423 ms | 105052 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<ll,ll>;
const ll maxn=3e5+10;
vector<pii> g[maxn];
multiset<ll> slope[maxn];
void dfs(ll node,ll c=-1){
for(auto i:g[node]){
dfs(i.first,i.second);
}
pair<ll,ll> maxi={-1,-1};
for(auto i:g[node]){
maxi=max(maxi,{ll(slope[i.first].size()),i.first});
}
if(maxi.first!=-1){
swap(slope[maxi.second],slope[node]);
for(auto i:g[node]){
if(i.first==maxi.second) continue;
for(ll j:slope[i.first]){
slope[node].emplace(j);
}
}
}
for(int i=0;i<ll(g[node].size())-1;i++){
auto it=slope[node].end();
# | 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... |