# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
427067 |
2021-06-14T12:08:29 Z |
jamezzz |
City (JOI17_city) |
C++17 |
|
604 ms |
41724 KB |
#include "Encoder.h"
#include <bits/stdc++.h>
using namespace std;
#define sf scanf
#define pf printf
#define fi first
#define se second
#define pb emplace_back
#define sz(x) (int)x.size()
#define all(x) x.begin(),x.end()
typedef long long ll;
typedef pair<int,int> ii;
#define maxn 250005
ll pre[maxn],pst[maxn],cnt;
vector<int> AL[maxn];
void dfs(int u){
pre[u]=cnt++;
for(int v:AL[u]){
if(pre[v]==-1)dfs(v);
}
pst[u]=cnt-1;
}
void Encode(int n,int a[],int b[]){
memset(pre,-1,sizeof pre);
for(int i=0;i<n-1;++i){
AL[a[i]].pb(b[i]);
AL[b[i]].pb(a[i]);
}
dfs(0);
for(int i=0;i<n;++i){
bitset<36> bs((pre[i]<<18)+pst[i]);
Code(i,(pre[i]<<18)+pst[i]);
}
}
#include "Device.h"
#include <bits/stdc++.h>
using namespace std;
#define sf scanf
#define pf printf
#define fi first
#define se second
#define pb emplace_back
#define sz(x) (int)x.size()
#define all(x) x.begin(),x.end()
typedef long long ll;
typedef pair<int,int> ii;
int ones=(1<<18)-1;
void InitDevice(){
}
int Answer(ll S, ll T){
ll pstS=S&ones,pstT=T&ones;
S>>=18;T>>=18;
if(T<=S&&S<=pstT)return 0;
if(S<=T&&T<=pstS)return 1;
return 2;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
8448 KB |
Output is correct |
2 |
Correct |
6 ms |
8456 KB |
Output is correct |
3 |
Correct |
7 ms |
8448 KB |
Output is correct |
4 |
Correct |
7 ms |
8448 KB |
Output is correct |
5 |
Correct |
7 ms |
8424 KB |
Output is correct |
6 |
Correct |
7 ms |
8348 KB |
Output is correct |
7 |
Correct |
6 ms |
8456 KB |
Output is correct |
8 |
Correct |
6 ms |
8448 KB |
Output is correct |
9 |
Correct |
6 ms |
8448 KB |
Output is correct |
10 |
Correct |
6 ms |
8448 KB |
Output is correct |
11 |
Correct |
6 ms |
8448 KB |
Output is correct |
12 |
Correct |
5 ms |
8360 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
191 ms |
16980 KB |
Output is correct - L = 183239355 |
2 |
Correct |
242 ms |
16868 KB |
Output is correct - L = 182977210 |
3 |
Correct |
204 ms |
16896 KB |
Output is correct - L = 183239355 |
4 |
Correct |
193 ms |
16968 KB |
Output is correct - L = 183239355 |
5 |
Partially correct |
604 ms |
40944 KB |
Output is partially correct - L = 65535987855 |
6 |
Partially correct |
486 ms |
41060 KB |
Output is partially correct - L = 65535987855 |
7 |
Partially correct |
573 ms |
40972 KB |
Output is partially correct - L = 65535987855 |
8 |
Partially correct |
533 ms |
40720 KB |
Output is partially correct - L = 65535987855 |
9 |
Partially correct |
441 ms |
41632 KB |
Output is partially correct - L = 65535987855 |
10 |
Partially correct |
436 ms |
41700 KB |
Output is partially correct - L = 65535987855 |
11 |
Partially correct |
446 ms |
41704 KB |
Output is partially correct - L = 65535987855 |
12 |
Partially correct |
469 ms |
41724 KB |
Output is partially correct - L = 65535987855 |
13 |
Partially correct |
588 ms |
41496 KB |
Output is partially correct - L = 65535987855 |
14 |
Partially correct |
505 ms |
41284 KB |
Output is partially correct - L = 65535987855 |
15 |
Correct |
190 ms |
16900 KB |
Output is correct - L = 183239355 |
16 |
Correct |
192 ms |
17012 KB |
Output is correct - L = 183239355 |
17 |
Correct |
191 ms |
16916 KB |
Output is correct - L = 183239355 |
18 |
Partially correct |
493 ms |
41348 KB |
Output is partially correct - L = 65535987855 |
19 |
Partially correct |
468 ms |
41216 KB |
Output is partially correct - L = 65535987855 |
20 |
Partially correct |
459 ms |
41176 KB |
Output is partially correct - L = 65535987855 |
21 |
Partially correct |
473 ms |
41312 KB |
Output is partially correct - L = 65535987855 |
22 |
Partially correct |
480 ms |
41128 KB |
Output is partially correct - L = 65535987855 |
23 |
Partially correct |
562 ms |
41144 KB |
Output is partially correct - L = 65535987855 |
24 |
Partially correct |
484 ms |
41268 KB |
Output is partially correct - L = 65535987855 |
25 |
Partially correct |
489 ms |
41136 KB |
Output is partially correct - L = 65535987855 |
26 |
Partially correct |
514 ms |
40980 KB |
Output is partially correct - L = 65535987855 |
27 |
Partially correct |
533 ms |
40956 KB |
Output is partially correct - L = 65535987855 |