# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
426638 |
2021-06-14T08:25:32 Z |
송준혁(#7530) |
City (JOI17_city) |
C++14 |
|
232 ms |
27568 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 int 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);
}
Code(u, I[u]*250505+num);
}
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/250505, r1 = S%250505;
int l2 = T/250505, r2 = T%250505;
if (l1 <= l2 && r2 <= r1) return 1;
if (l2 <= l1 && r1 <= r2) return 0;
return 2;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
7680 KB |
Output is correct |
2 |
Correct |
7 ms |
7680 KB |
Output is correct |
3 |
Correct |
8 ms |
7736 KB |
Output is correct |
4 |
Correct |
5 ms |
7680 KB |
Output is correct |
5 |
Correct |
6 ms |
7724 KB |
Output is correct |
6 |
Correct |
7 ms |
7680 KB |
Output is correct |
7 |
Correct |
5 ms |
7716 KB |
Output is correct |
8 |
Correct |
5 ms |
7680 KB |
Output is correct |
9 |
Correct |
6 ms |
7724 KB |
Output is correct |
10 |
Correct |
5 ms |
7688 KB |
Output is correct |
11 |
Correct |
5 ms |
7692 KB |
Output is correct |
12 |
Correct |
5 ms |
7680 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
232 ms |
23084 KB |
Output is correct - L = 175354200 |
2 |
Correct |
200 ms |
23096 KB |
Output is correct - L = 175103694 |
3 |
Correct |
207 ms |
23096 KB |
Output is correct - L = 175354200 |
4 |
Correct |
191 ms |
23172 KB |
Output is correct - L = 175354200 |
5 |
Incorrect |
218 ms |
27568 KB |
Wrong Answer [3] |
6 |
Halted |
0 ms |
0 KB |
- |