# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
100652 | Pro_ktmr | Snowy Roads (JOI16_snowy) | C++14 | 26 ms | 1460 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;
#include"Anyalib.h"
#define MP(a,b) make_pair(a,b)
static int n;
static int par[500];
static int toPar[500];
static int d[500] = {};
static int depth(int i){
if(i == 0) return 0;
if(d[i] != 0) return d[i];
return d[i] = 1 + depth(par[i]);
}
static vector<int> ls;
void InitAnya(int N, int A[], int B[]){
n = N;
vector<pair<int,int> > tonari[500];
for(int i=0; i<N-1; i++){
tonari[A[i]].push_back(MP(B[i],i));
tonari[B[i]].push_back(MP(A[i],i));
}
par[0] = 0;
toPar[0] = -1;
queue<int> que;
que.push(0);
while(!que.empty()){
Compilation message (stderr)
# | 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... |