제출 #128523

#제출 시각아이디문제언어결과실행 시간메모리
128523briansuCity (JOI17_city)C++14
22 / 100
591 ms80720 KiB
#include "Encoder.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll,ll> ii; #define REP(i, n) for(int i = 0;i < n;i ++) #define REP1(i, n) for(int i = 1;i <= n;i ++) #define FILL(i, n) memset(i, n, sizeof(i)) #define X first #define Y second #define pb push_back #define SZ(_a) ((int)(_a).size()) #define ALL(_a) (_a).begin(), (_a).end() #ifdef brian #define IOS() template<typename T>static void _do(T &&x){cerr<<x<<endl;} template<typename T, typename ...t>static void _do(T &&x, t &&...X){cerr<<x<<", ";_do(X...);} #define debug(...) {\ fprintf(stderr, "%s - %d (%s) = ", __PRETTY_FUNCTION__, __LINE__, #__VA_ARGS__);\ _do(__VA_ARGS__);\ } #else #define debug(...) #define IOS() ios_base::sync_with_stdio(0);cin.tie(0); #define endl '\n' #endif const ll MAXn = 3e5 + 5; const ll INF = ll(1e17); vector<ll> v[MAXn]; ll n, tit = 0, in[MAXn], out[MAXn]; void dfs(ll now,ll f) { in[now] = tit ++; for(ll k:v[now])if(k != f)dfs(k, now); out[now] = tit - 1; } void Encode(int N, int A[], int B[]) { n = N; REP(i, n - 1)v[A[i]].pb(B[i]), v[B[i]].pb(A[i]); dfs(0, -1); REP(i, n)Code(i, in[i] + (out[i] << 18)); }
#include "Device.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll,ll> ii; #define REP(i, n) for(int i = 0;i < n;i ++) #define REP1(i, n) for(int i = 1;i <= n;i ++) #define FILL(i, n) memset(i, n, sizeof(i)) #define X first #define Y second #define pb push_back #define SZ(_a) ((int)(_a).size()) #define ALL(_a) (_a).begin(), (_a).end() #ifdef brian #define IOS() template<typename T>static void _do(T &&x){cerr<<x<<endl;} template<typename T, typename ...t>static void _do(T &&x, t &&...X){cerr<<x<<", ";_do(X...);} #define debug(...) {\ fprintf(stderr, "%s - %d (%s) = ", __PRETTY_FUNCTION__, __LINE__, #__VA_ARGS__);\ _do(__VA_ARGS__);\ } #else #define debug(...) #define IOS() ios_base::sync_with_stdio(0);cin.tie(0); #define endl '\n' #endif void InitDevice() { } int Answer(long long S, long long T) { ll a = S & ((1 << 18) - 1), b = (S >> 18); ll c = T & ((1 << 18) - 1), d = (T >> 18); debug(a, b, c, d); if(a < c && d <= b)return 1; else if(c < a && b <= d)return 0; else return 2; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...