제출 #49415

#제출 시각아이디문제언어결과실행 시간메모리
49415SpaimaCarpatilorCity (JOI17_city)C++17
0 / 100
172 ms19480 KiB
#include "Encoder.h" #include<bits/stdc++.h> using namespace std; int nr = 0, l[250009], r[250009]; vector < int > v[250009]; void dfs (int nod, int tata) { l[nod] = ++nr; for (auto it : v[nod]) if (it != tata) dfs (it, nod); r[nod] = nr; } void Encode (int N, int A[], int B[]) { for (int i=0; i<N; i++) v[A[i]].push_back (B[i]); dfs (0, -1); for (int i=0; i<N; i++) Code(i, (l[i] << 18LL) | r[i]); }
#include "Device.h" #include<bits/stdc++.h> using namespace std; void InitDevice() { } int Answer (long long S, long long T) { int lS = (S >> 18), rS = S & ((1 << 18) - 1); int lT = (T >> 18), rT = T & ((1 << 18) - 1); if (lT <= lS && rS <= rT) return 0; if (lS <= lT && rT <= rS) return 1; return 2; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...