# |
제출 시각 |
아이디 |
문제 |
언어 |
결과 |
실행 시간 |
메모리 |
426650 |
2021-06-14T08:38:49 Z |
송준혁(#7530) |
City (JOI17_city) |
C++14 |
|
560 ms |
40304 KB |
#include "Encoder.h"
#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define lb lower_bound
#define MOD 1000000007
#define INF (1ll<<62)
using namespace std;
typedef long long LL;
typedef pair<int,int> pii;
static LL I[303030], num;
static vector<int> adj[303030];
static void f(int u, int p){
I[u] = ++num;
for (int v : adj[u]){
if (v == p) continue;
f(v, u);
}
int t=0;
while (num-I[u] > (1<<t)) t++;
num = I[u] + (1<<t);
Code(u, I[u]*20+t);
}
void Encode(int N, int A[], int B[]){
for (int i=0; i<N-1; i++) adj[A[i]].pb(B[i]), adj[B[i]].pb(A[i]);
f(0, -1);
}
#include "Device.h"
void InitDevice(){
}
int Answer(long long S, long long T){
int l1 = S/20, r1 = l1 + (1<<(S%20));
int l2 = T/20, r2 = l2 + (1<<(T%20));
if (l1 <= l2 && r2 <= r1) return 1;
if (l2 <= l1 && r1 <= r2) return 0;
return 2;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
7652 KB |
Output is correct |
2 |
Correct |
6 ms |
7680 KB |
Output is correct |
3 |
Correct |
6 ms |
7680 KB |
Output is correct |
4 |
Correct |
5 ms |
7680 KB |
Output is correct |
5 |
Correct |
6 ms |
7680 KB |
Output is correct |
6 |
Correct |
6 ms |
7676 KB |
Output is correct |
7 |
Correct |
5 ms |
7680 KB |
Output is correct |
8 |
Correct |
6 ms |
7656 KB |
Output is correct |
9 |
Correct |
6 ms |
7688 KB |
Output is correct |
10 |
Correct |
6 ms |
7744 KB |
Output is correct |
11 |
Correct |
5 ms |
7680 KB |
Output is correct |
12 |
Correct |
6 ms |
7680 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
207 ms |
16280 KB |
Output is correct - L = 184500 |
2 |
Correct |
259 ms |
16128 KB |
Output is correct - L = 1311800 |
3 |
Correct |
198 ms |
16184 KB |
Output is correct - L = 191400 |
4 |
Correct |
203 ms |
16196 KB |
Output is correct - L = 764920 |
5 |
Incorrect |
560 ms |
40304 KB |
Wrong Answer [6] |
6 |
Halted |
0 ms |
0 KB |
- |