# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
427300 | kai824 | City (JOI17_city) | C++17 | 661 ms | 47268 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 "Encoder.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<int> adjl[250005];
ll pre[250005],sub[250005],nex;
void dfs(int node,int p=-1){
pre[node]=nex++;
for(int x:adjl[node]){
if(x==p)continue;
dfs(x,node);
}
sub[node]=nex-1;
// cout<<node<<' '<<pre[node]<<' '<<sub[node]<<'\n';
Code(node,pre[node]*250000+sub[node]);
}
void Encode(int n, int a[], int b[]){
for(int i=0;i+1<n;i++){
adjl[a[i]].push_back(b[i]);
adjl[b[i]].push_back(a[i]);
}
dfs(0);
//Code(i, 0LL): node, label...
}
#include "Device.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
void InitDevice(){}
int Answer(long long s, long long t){
int p1,p2,s1,s2;
p1=s/250000;
s1=s%250000;
p2=t/250000;
s2=t%250000;
if(p1<p2 && p2<=s1)return 1;
if(p2<p1 && p1<=s2)return 0;
return 2;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |