# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1126706 | czauderna | Road Closures (APIO21_roads) | C++20 | 2096 ms | 26180 KiB |
#include "roads.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define st first
#define nd second
#define pb push_back
const int NN = 1e5+3;
const ll INF = 1e16;
vector<int> inp[NN], Vdeg[NN], grf[NN];
int pre[NN], cnt;
bool odw[NN];
ll Dp[NN][2], C[NN];
// dla n^2 log
vector<ll> tmpX, tmpY;
bool comp(int a, int b){
return (int)inp[a].size() > (int)inp[b].size();
}
void set_pre(int v, int p){
pre[v]=cnt; cnt++;
for(auto w:inp[v]){
if(w==p) continue;
set_pre(w, v);
}
}
int get_x(int v, int k){
int out=0;
for(auto w:inp[v]) if((int)inp[w].size()<=k && pre[v]<pre[w]) out++, tmpX.pb(C[w]);
sort(tmpX.begin(), tmpX.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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |