제출 #427300

#제출 시각아이디문제언어결과실행 시간메모리
427300kai824City (JOI17_city)C++17
22 / 100
661 ms47268 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...