#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define debug(...)
#endif
using ll=long long;
using pii=array<int,2>;
using tii=array<int,3>;
using ti4=array<int,4>;
const int N=1500005;
struct node {
int p = 0, c[2] = {0, 0}, pp = 0;
bool flip = 0;
int sz = 0, ssz = 0, vsz = 0; // sz -> aux tree size, ssz = subtree size in rep tree, vsz = virtual tree size
node() {}
node(int x) {
sz = 1;
}
};
struct LCT {
vector<node> t;
LCT() {}
LCT(int n) : t(n + 1) {}
int dir(int x, int y) { return t[x].c[1] == y; }
void set(int x, int d, int y) {
if (x) t[x].c[d] = y, pull(x);
if (y) t[y].p = x;
}
void pull(int x) {
if (!x) return;
int &l = t[x].c[0], &r = t[x].c[1];
t[x].sz = t[l].sz + t[r].sz + 1;
t[x].ssz = t[l].ssz + t[r].ssz + t[x].vsz + 1;
}
void push(int x) {
if (!x) return;
int &l = t[x].c[0], &r = t[x].c[1];
if (t[x].flip) {
swap(l, r);
if (l) t[l].flip ^= 1;
if (r) t[r].flip ^= 1;
t[x].flip = 0;
}
}
void rotate(int x, int d) {
int y = t[x].p, z = t[y].p, w = t[x].c[d];
swap(t[x].pp, t[y].pp);
set(y, !d, w); set(x, d, y); set(z, dir(z, y), x);
}
void splay(int x) {
for (push(x); t[x].p;) {
int y = t[x].p, z = t[y].p;
push(z); push(y); push(x);
int dx = dir(y, x), dy = dir(z, y);
if (!z) rotate(x, !dx);
else if (dx == dy) rotate(y, !dx), rotate(x, !dx);
else rotate(x, dy), rotate(x, dx);
}
}
// making it a root in the rep. tree
void make_root(int u) {
access(u); int l = t[u].c[0];
t[l].flip ^= 1; swap(t[l].p, t[l].pp);
t[u].vsz += t[l].ssz;
set(u, 0, 0);
}
// make the path from root to u a preferred path
// returns last path-parent of a node as it moves up the tree
int access(int _u) {
int last = _u;
for (int v = 0, u = _u; u; u = t[v = u].pp) {
splay(u); splay(v);
t[u].vsz -= t[v].ssz;
int r = t[u].c[1]; t[u].vsz += t[r].ssz;
t[v].pp = 0;
swap(t[r].p, t[r].pp); set(u, 1, v);
last = u;
}
splay(_u); return last;
}
void link(int u, int v) { // u -> v
// assert(!connected(u, v));
make_root(v);
access(u); splay(u);
t[v].pp = u; t[u].vsz += t[v].ssz;
}
void cut(int u) { // cut par[u] -> u, u is non root vertex
access(u); assert(t[u].c[0] != 0);
t[t[u].c[0]].p = 0; t[u].c[0] = 0; pull(u);
}
// parent of u in the rep. tree
int get_parent(int u) {
access(u); splay(u); push(u);
u = t[u].c[0]; push(u);
while (t[u].c[1]) { u = t[u].c[1]; push(u); }
splay(u); return u;
}
// root of the rep. tree containing this node
int find_root(int u) {
access(u); splay(u); push(u);
while (t[u].c[0]) { u = t[u].c[0]; push(u); }
splay(u); return u;
}
int size(int u) { return t[find_root(u)].ssz; }
}t;
int n,q,e;
ll prv;
ll C,F[N];
void add(int i,ll v){
i=q+1-i;
for(;i<=q+1;i+=i&-i) F[i]+=v;
}
ll qry(int i){
i=q+1-i;
ll r=0;
for(;i;i-=i&-i) r+=F[i];
return r;
}
int main(){
ios::sync_with_stdio(false); cin.tie(0);
cin>>e>>n>>q;
t=LCT(n);
for(int i=1;i<=n;i++) t.t[i]=node(i);
for(int op,i=1;i<=q;i++){
cin>>op;
if(op==1){
ll x,y;
cin>>x>>y;
if(e){
x^=prv;
y^=prv;
}
ll sz1=t.size(x),sz2=t.size(y);
C-=sz1*(sz1-1)/2+sz2*(sz2-1)/2;
C+=(sz1+sz2)*(sz1+sz2-1)/2;
t.link(x,y);
} else if(op==2){
ll x,y;
cin>>x>>y;
if(e){
x^=prv;
y^=prv;
}
t.make_root(x);
t.cut(y);
ll sz1=t.size(x),sz2=t.size(y);
C-=sz1*sz2;
add(i-1,sz1*sz2);
} else{
ll t;
cin>>t;
if(e) t^=prv;
ll ans=C+qry(i-t);
cout<<ans<<"\n";
prv=ans;
}
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
0 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
0 ms |
376 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
464 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
460 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
600 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
468 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
464 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
0 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
0 ms |
348 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
0 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
0 ms |
376 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
464 KB |
Output is correct |
29 |
Correct |
2 ms |
604 KB |
Output is correct |
30 |
Correct |
1 ms |
604 KB |
Output is correct |
31 |
Correct |
1 ms |
604 KB |
Output is correct |
32 |
Correct |
2 ms |
604 KB |
Output is correct |
33 |
Correct |
1 ms |
604 KB |
Output is correct |
34 |
Correct |
1 ms |
604 KB |
Output is correct |
35 |
Correct |
1 ms |
604 KB |
Output is correct |
36 |
Correct |
1 ms |
604 KB |
Output is correct |
37 |
Correct |
1 ms |
604 KB |
Output is correct |
38 |
Correct |
2 ms |
760 KB |
Output is correct |
39 |
Correct |
1 ms |
604 KB |
Output is correct |
40 |
Correct |
1 ms |
604 KB |
Output is correct |
41 |
Correct |
2 ms |
604 KB |
Output is correct |
42 |
Correct |
2 ms |
592 KB |
Output is correct |
43 |
Correct |
1 ms |
600 KB |
Output is correct |
44 |
Correct |
1 ms |
604 KB |
Output is correct |
45 |
Correct |
1 ms |
484 KB |
Output is correct |
46 |
Correct |
2 ms |
608 KB |
Output is correct |
47 |
Correct |
2 ms |
604 KB |
Output is correct |
48 |
Correct |
1 ms |
604 KB |
Output is correct |
49 |
Correct |
1 ms |
604 KB |
Output is correct |
50 |
Correct |
1 ms |
348 KB |
Output is correct |
51 |
Correct |
1 ms |
476 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
460 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
600 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
468 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
464 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
0 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
0 ms |
348 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
348 KB |
Output is correct |
29 |
Correct |
2 ms |
604 KB |
Output is correct |
30 |
Correct |
1 ms |
604 KB |
Output is correct |
31 |
Correct |
1 ms |
604 KB |
Output is correct |
32 |
Correct |
2 ms |
604 KB |
Output is correct |
33 |
Correct |
2 ms |
468 KB |
Output is correct |
34 |
Correct |
1 ms |
604 KB |
Output is correct |
35 |
Correct |
1 ms |
604 KB |
Output is correct |
36 |
Correct |
1 ms |
604 KB |
Output is correct |
37 |
Correct |
1 ms |
604 KB |
Output is correct |
38 |
Correct |
1 ms |
604 KB |
Output is correct |
39 |
Correct |
2 ms |
604 KB |
Output is correct |
40 |
Correct |
1 ms |
604 KB |
Output is correct |
41 |
Correct |
1 ms |
604 KB |
Output is correct |
42 |
Correct |
1 ms |
604 KB |
Output is correct |
43 |
Correct |
1 ms |
604 KB |
Output is correct |
44 |
Correct |
1 ms |
644 KB |
Output is correct |
45 |
Correct |
1 ms |
612 KB |
Output is correct |
46 |
Correct |
2 ms |
604 KB |
Output is correct |
47 |
Correct |
2 ms |
648 KB |
Output is correct |
48 |
Correct |
1 ms |
620 KB |
Output is correct |
49 |
Correct |
1 ms |
604 KB |
Output is correct |
50 |
Correct |
1 ms |
604 KB |
Output is correct |
51 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
0 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
0 ms |
376 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
464 KB |
Output is correct |
29 |
Correct |
2 ms |
604 KB |
Output is correct |
30 |
Correct |
1 ms |
604 KB |
Output is correct |
31 |
Correct |
1 ms |
604 KB |
Output is correct |
32 |
Correct |
2 ms |
604 KB |
Output is correct |
33 |
Correct |
1 ms |
604 KB |
Output is correct |
34 |
Correct |
1 ms |
604 KB |
Output is correct |
35 |
Correct |
1 ms |
604 KB |
Output is correct |
36 |
Correct |
1 ms |
604 KB |
Output is correct |
37 |
Correct |
1 ms |
604 KB |
Output is correct |
38 |
Correct |
2 ms |
760 KB |
Output is correct |
39 |
Correct |
1 ms |
604 KB |
Output is correct |
40 |
Correct |
1 ms |
604 KB |
Output is correct |
41 |
Correct |
2 ms |
604 KB |
Output is correct |
42 |
Correct |
2 ms |
592 KB |
Output is correct |
43 |
Correct |
1 ms |
600 KB |
Output is correct |
44 |
Correct |
1 ms |
604 KB |
Output is correct |
45 |
Correct |
1 ms |
484 KB |
Output is correct |
46 |
Correct |
2 ms |
608 KB |
Output is correct |
47 |
Correct |
2 ms |
604 KB |
Output is correct |
48 |
Correct |
1 ms |
604 KB |
Output is correct |
49 |
Correct |
1 ms |
604 KB |
Output is correct |
50 |
Correct |
1 ms |
348 KB |
Output is correct |
51 |
Correct |
1 ms |
476 KB |
Output is correct |
52 |
Correct |
63 ms |
9044 KB |
Output is correct |
53 |
Correct |
64 ms |
9300 KB |
Output is correct |
54 |
Correct |
63 ms |
9556 KB |
Output is correct |
55 |
Correct |
78 ms |
8620 KB |
Output is correct |
56 |
Correct |
69 ms |
9040 KB |
Output is correct |
57 |
Correct |
65 ms |
9752 KB |
Output is correct |
58 |
Correct |
66 ms |
9088 KB |
Output is correct |
59 |
Correct |
90 ms |
9044 KB |
Output is correct |
60 |
Correct |
66 ms |
8276 KB |
Output is correct |
61 |
Correct |
57 ms |
6256 KB |
Output is correct |
62 |
Correct |
59 ms |
7840 KB |
Output is correct |
63 |
Correct |
55 ms |
7508 KB |
Output is correct |
64 |
Correct |
66 ms |
9044 KB |
Output is correct |
65 |
Correct |
58 ms |
8428 KB |
Output is correct |
66 |
Correct |
70 ms |
10324 KB |
Output is correct |
67 |
Correct |
79 ms |
9200 KB |
Output is correct |
68 |
Correct |
69 ms |
9272 KB |
Output is correct |
69 |
Correct |
152 ms |
9284 KB |
Output is correct |
70 |
Correct |
107 ms |
9112 KB |
Output is correct |
71 |
Correct |
71 ms |
10020 KB |
Output is correct |
72 |
Correct |
72 ms |
10016 KB |
Output is correct |
73 |
Correct |
41 ms |
8020 KB |
Output is correct |
74 |
Correct |
40 ms |
6396 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
460 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
600 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
468 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
464 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
0 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
0 ms |
348 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
348 KB |
Output is correct |
29 |
Correct |
2 ms |
604 KB |
Output is correct |
30 |
Correct |
1 ms |
604 KB |
Output is correct |
31 |
Correct |
1 ms |
604 KB |
Output is correct |
32 |
Correct |
2 ms |
604 KB |
Output is correct |
33 |
Correct |
2 ms |
468 KB |
Output is correct |
34 |
Correct |
1 ms |
604 KB |
Output is correct |
35 |
Correct |
1 ms |
604 KB |
Output is correct |
36 |
Correct |
1 ms |
604 KB |
Output is correct |
37 |
Correct |
1 ms |
604 KB |
Output is correct |
38 |
Correct |
1 ms |
604 KB |
Output is correct |
39 |
Correct |
2 ms |
604 KB |
Output is correct |
40 |
Correct |
1 ms |
604 KB |
Output is correct |
41 |
Correct |
1 ms |
604 KB |
Output is correct |
42 |
Correct |
1 ms |
604 KB |
Output is correct |
43 |
Correct |
1 ms |
604 KB |
Output is correct |
44 |
Correct |
1 ms |
644 KB |
Output is correct |
45 |
Correct |
1 ms |
612 KB |
Output is correct |
46 |
Correct |
2 ms |
604 KB |
Output is correct |
47 |
Correct |
2 ms |
648 KB |
Output is correct |
48 |
Correct |
1 ms |
620 KB |
Output is correct |
49 |
Correct |
1 ms |
604 KB |
Output is correct |
50 |
Correct |
1 ms |
604 KB |
Output is correct |
51 |
Correct |
1 ms |
348 KB |
Output is correct |
52 |
Correct |
69 ms |
11420 KB |
Output is correct |
53 |
Correct |
73 ms |
11584 KB |
Output is correct |
54 |
Correct |
66 ms |
10324 KB |
Output is correct |
55 |
Correct |
83 ms |
11224 KB |
Output is correct |
56 |
Correct |
76 ms |
10668 KB |
Output is correct |
57 |
Correct |
68 ms |
10064 KB |
Output is correct |
58 |
Correct |
80 ms |
11428 KB |
Output is correct |
59 |
Correct |
72 ms |
11092 KB |
Output is correct |
60 |
Correct |
71 ms |
10120 KB |
Output is correct |
61 |
Correct |
65 ms |
11484 KB |
Output is correct |
62 |
Correct |
67 ms |
11432 KB |
Output is correct |
63 |
Correct |
66 ms |
12624 KB |
Output is correct |
64 |
Correct |
67 ms |
11296 KB |
Output is correct |
65 |
Correct |
66 ms |
11348 KB |
Output is correct |
66 |
Correct |
72 ms |
12308 KB |
Output is correct |
67 |
Correct |
70 ms |
10836 KB |
Output is correct |
68 |
Correct |
79 ms |
9300 KB |
Output is correct |
69 |
Correct |
153 ms |
11400 KB |
Output is correct |
70 |
Correct |
110 ms |
10840 KB |
Output is correct |
71 |
Correct |
82 ms |
10324 KB |
Output is correct |
72 |
Correct |
68 ms |
10324 KB |
Output is correct |
73 |
Correct |
41 ms |
8276 KB |
Output is correct |
74 |
Correct |
38 ms |
6484 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
460 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
600 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
468 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
464 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
0 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
0 ms |
348 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
348 KB |
Output is correct |
29 |
Correct |
2 ms |
604 KB |
Output is correct |
30 |
Correct |
1 ms |
604 KB |
Output is correct |
31 |
Correct |
1 ms |
604 KB |
Output is correct |
32 |
Correct |
2 ms |
604 KB |
Output is correct |
33 |
Correct |
2 ms |
468 KB |
Output is correct |
34 |
Correct |
1 ms |
604 KB |
Output is correct |
35 |
Correct |
1 ms |
604 KB |
Output is correct |
36 |
Correct |
1 ms |
604 KB |
Output is correct |
37 |
Correct |
1 ms |
604 KB |
Output is correct |
38 |
Correct |
1 ms |
604 KB |
Output is correct |
39 |
Correct |
2 ms |
604 KB |
Output is correct |
40 |
Correct |
1 ms |
604 KB |
Output is correct |
41 |
Correct |
1 ms |
604 KB |
Output is correct |
42 |
Correct |
1 ms |
604 KB |
Output is correct |
43 |
Correct |
1 ms |
604 KB |
Output is correct |
44 |
Correct |
1 ms |
644 KB |
Output is correct |
45 |
Correct |
1 ms |
612 KB |
Output is correct |
46 |
Correct |
2 ms |
604 KB |
Output is correct |
47 |
Correct |
2 ms |
648 KB |
Output is correct |
48 |
Correct |
1 ms |
620 KB |
Output is correct |
49 |
Correct |
1 ms |
604 KB |
Output is correct |
50 |
Correct |
1 ms |
604 KB |
Output is correct |
51 |
Correct |
1 ms |
348 KB |
Output is correct |
52 |
Correct |
69 ms |
11420 KB |
Output is correct |
53 |
Correct |
73 ms |
11584 KB |
Output is correct |
54 |
Correct |
66 ms |
10324 KB |
Output is correct |
55 |
Correct |
83 ms |
11224 KB |
Output is correct |
56 |
Correct |
76 ms |
10668 KB |
Output is correct |
57 |
Correct |
68 ms |
10064 KB |
Output is correct |
58 |
Correct |
80 ms |
11428 KB |
Output is correct |
59 |
Correct |
72 ms |
11092 KB |
Output is correct |
60 |
Correct |
71 ms |
10120 KB |
Output is correct |
61 |
Correct |
65 ms |
11484 KB |
Output is correct |
62 |
Correct |
67 ms |
11432 KB |
Output is correct |
63 |
Correct |
66 ms |
12624 KB |
Output is correct |
64 |
Correct |
67 ms |
11296 KB |
Output is correct |
65 |
Correct |
66 ms |
11348 KB |
Output is correct |
66 |
Correct |
72 ms |
12308 KB |
Output is correct |
67 |
Correct |
70 ms |
10836 KB |
Output is correct |
68 |
Correct |
79 ms |
9300 KB |
Output is correct |
69 |
Correct |
153 ms |
11400 KB |
Output is correct |
70 |
Correct |
110 ms |
10840 KB |
Output is correct |
71 |
Correct |
82 ms |
10324 KB |
Output is correct |
72 |
Correct |
68 ms |
10324 KB |
Output is correct |
73 |
Correct |
41 ms |
8276 KB |
Output is correct |
74 |
Correct |
38 ms |
6484 KB |
Output is correct |
75 |
Correct |
400 ms |
59732 KB |
Output is correct |
76 |
Correct |
390 ms |
56404 KB |
Output is correct |
77 |
Correct |
347 ms |
50772 KB |
Output is correct |
78 |
Correct |
475 ms |
59608 KB |
Output is correct |
79 |
Correct |
494 ms |
52940 KB |
Output is correct |
80 |
Correct |
374 ms |
52308 KB |
Output is correct |
81 |
Correct |
407 ms |
59992 KB |
Output is correct |
82 |
Correct |
379 ms |
56980 KB |
Output is correct |
83 |
Correct |
382 ms |
53076 KB |
Output is correct |
84 |
Correct |
392 ms |
58724 KB |
Output is correct |
85 |
Correct |
369 ms |
58452 KB |
Output is correct |
86 |
Correct |
404 ms |
55284 KB |
Output is correct |
87 |
Correct |
378 ms |
58576 KB |
Output is correct |
88 |
Correct |
343 ms |
56688 KB |
Output is correct |
89 |
Correct |
379 ms |
60156 KB |
Output is correct |
90 |
Correct |
381 ms |
58964 KB |
Output is correct |
91 |
Correct |
371 ms |
59460 KB |
Output is correct |
92 |
Correct |
488 ms |
63836 KB |
Output is correct |
93 |
Correct |
367 ms |
55508 KB |
Output is correct |
94 |
Correct |
455 ms |
56148 KB |
Output is correct |
95 |
Correct |
884 ms |
55624 KB |
Output is correct |
96 |
Correct |
653 ms |
58736 KB |
Output is correct |
97 |
Correct |
376 ms |
52616 KB |
Output is correct |
98 |
Correct |
367 ms |
52780 KB |
Output is correct |
99 |
Correct |
212 ms |
42584 KB |
Output is correct |
100 |
Correct |
196 ms |
31896 KB |
Output is correct |
101 |
Correct |
0 ms |
348 KB |
Output is correct |