제출 #551925

#제출 시각아이디문제언어결과실행 시간메모리
551925LoboCity (JOI17_city)C++17
0 / 100
175 ms16220 KiB
#include "Encoder.h" #include<bits/stdc++.h> using namespace std; const long long inf = (long long) 1e18 + 10; const int inf1 = (int) 1e9 + 10; #define int long long #define dbl long double #define endl '\n' #define sc second #define fr first #define mp make_pair #define pb push_back #define all(x) x.begin(), x.end() const int maxn = 3e5+10; int tin[maxn], tout[maxn], timer; vector<int> g[maxn]; void dfs(int u, int ant) { tin[u] = ++timer; for(auto v : g[u]) if(v != ant) { dfs(v,u); } tout[u] = timer; } void Encode(int32_t N, int32_t A[], int32_t B[]) { for(int i = 0; i < N-1; i++) { g[A[i]].pb(B[i]); g[B[i]].pb(A[i]); } dfs(0,0); for(int i = 0; i < N; i++) { Code(i,tin[i]+1000000*tout[i]); } }
#include "Device.h" #include<bits/stdc++.h> using namespace std; const long long inf = (long long) 1e18 + 10; const int inf1 = (int) 1e9 + 10; #define int long long #define dbl long double #define endl '\n' #define sc second #define fr first #define mp make_pair #define pb push_back #define all(x) x.begin(), x.end() const int maxn = -1; void InitDevice() {} int32_t Answer(int S, int T) { int in1 = S/(1000000); int out1 = S-in1*1000000; int in2 = T/(1000000); int out2 = T-in2*1000000; if(in1 <= in2 && out1 >= out2) { return 1; } else if(in2 <= in1 && out2 >= out1) { return 0; } else { return 2; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...