Submission #363674

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
3636742021-02-06 19:25:33denkendoemeerCity (JOI17_city)C++14
100 / 100
494 ms54164 KiB
#include "Encoder.h"
#include<bits/stdc++.h>
using namespace std;
vector<int>g[250005],r;
int in[250005],t[250005],u;
void dfs(int nod,int ta)
{
in[nod]=u++;
for(auto it:g[nod]){
if (it!=ta)
dfs(it,nod);
}
if (in[nod]==u-1)
return ;
int &ans=t[nod];
while(in[nod]+r[ans]<u-1)
ans++;
u=in[nod]+r[ans]+1;
}
void Encode(int n,int a[],int b[])
{
double d=1.050045;
r.push_back(0);
int i;
for(i=1;i<256;i++){
int aux=d*r.back();
if (r.back()==aux)
++aux;
r.push_back(aux);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...