Submission #147335

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1473352019-08-28 20:45:00mosiashvililukaRace (IOI11_race)C++14
100 / 100
855 ms49272 KiB
#include<bits/stdc++.h>
#include "race.h"
#define mk make_pair
#define pll pair <long long, long long>
using namespace std;
long long a,b,c,d,e,pas=999999999999999999LL,k,pi,p[200009],dp[200009],cnt,dep[200009],msh[200009],koka;
bool was[200009];
vector <pair <long long, long long> > v[200009];
pair <long long, long long> z[1000009];
void dfs(long long q, long long w){
pi++;
p[pi]=q;
dp[q]=1;
msh[q]=w;
for(vector <pll>::iterator it=v[q].begin(); it!=v[q].end(); it++){
if((*it).first==w||was[(*it).first]==1) continue;
dfs((*it).first,q);
dp[q]+=dp[(*it).first];
}
}
void dfs2(long long q, long long w, long long r){
dep[q]=dep[w]+1;
if(r<=k&&z[k-r].second==cnt){
if(pas>dep[q]+z[k-r].first){
// cout<<q<<" "<<z[k-r].second<<" "<<koka<<endl;
pas=dep[q]+z[k-r].first;
}
}
for(vector <pll>::iterator it=v[q].begin(); it!=v[q].end(); it++){
if((*it).first==w||was[(*it).first]==1) continue;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...