제출 #1008911

#제출 시각아이디문제언어결과실행 시간메모리
1008911emptypringlescanCity (JOI17_city)C++17
22 / 100
216 ms55472 KiB
#include <bits/stdc++.h> using namespace std; #include "Encoder.h" vector<int> adj[250005]; long long pre[250005],pos[250005]; int cur=0; void dfs(int x, int p){ cur++; pre[x]=cur; for(int i:adj[x]){ if(i!=p) dfs(i,x); } pos[x]=cur; } void Encode(int n, int u[], int v[]){ for(int i=0; i<n-1; i++){ adj[u[i]].push_back(v[i]); adj[v[i]].push_back(u[i]); } dfs(0,-1); for(int i=0; i<n; i++){ Code(i,pre[i]<<18ll|pos[i]); } }
#include <bits/stdc++.h> using namespace std; #include "Device.h" void InitDevice(){ } int Answer(long long a, long long b){ long long prea=a>>18ll,posa=a^(prea<<18ll); long long preb=b>>18ll,posb=b^(preb<<18ll); if(preb<=prea&&posa<=posb) return 0; else if(prea<=preb&&posb<=posa) return 1; return 2; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...