제출 #67270

#제출 시각아이디문제언어결과실행 시간메모리
67270ikura355City (JOI17_city)C++14
22 / 100
536 ms60680 KiB
#include "Encoder.h" #include<bits/stdc++.h> using namespace std; #define ll long long const int maxn = 250000 + 5; int n; vector<int> way[maxn]; ll cur, st[maxn], ft[maxn]; void dfs(int u, int last) { st[u] = ++cur; for(auto v : way[u]) { if(v==last) continue; dfs(v,u); } ft[u] = cur; } void Encode(int N, int A[], int B[]) { n = N; for(int i=0;i<n-1;i++) { way[A[i]].push_back(B[i]); way[B[i]].push_back(A[i]); } cur = -1; dfs(0,-1); ll wow = (1<<18); for(int i=0;i<n;i++) Code(i,st[i]*wow + ft[i]); }
#include "Device.h" #include<bits/stdc++.h> using namespace std; #define ll long long void InitDevice() { } int Answer(long long S, long long T) { ll wow = (1<<18); ll lu = S/wow, ru = S%wow; ll lv = T/wow, rv = T%wow; if(lv<=lu && lu<=rv) return 0; if(lu<=lv && lv<=ru) return 1; return 2; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...