# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
548061 |
2022-04-12T10:08:29 Z |
fcmalkcin |
Jail (JOI22_jail) |
C++17 |
|
970 ms |
62356 KB |
#include<bits/stdc++.h>
using namespace std;
#define ll int
#define pll pair<ll,ll>
#define ff first
#define ss second
#define endl "\n"
#define pb push_back
#define F(i,a,b) for(ll i=a;i<=b;i++)
const ll maxn=1e5+2e4+100;
//const ll maxn=100;
const ll base=3e18;
const ll mod= 1e9+7 ;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
/// have medal in APIO
/// goal 2/8
struct tk
{
ll pos;
ll pos1;
tk ()
{
pos=-1;
pos1=-1;
}
};
ll id1[maxn];
tk st[2*maxn];
vector<ll> st1[2*maxn][2];
ll col[maxn];
tk mer(tk a,tk b)
{
a.pos=max(a.pos,b.pos);
a.pos1=max(a.pos1,b.pos1);
return a;
}
bool chk1(ll u,ll c)
{
if (u==-1)
return true;
return (col[u]==c);
}
tk getr(ll id,ll l,ll r,ll x)
{
tk c;
if (x>r||x<l)
return c;
for (int t=0; t<=1; t++)
{
bool chk=false;
while (st1[id][t].size())
{
ll h=st1[id][t].back();
st1[id][t].pop_back();
if (!chk1(h,t))
continue;
if (h==id1[x])
{
chk=true;
continue;
}
if (t==0)
c.pos=h;
else
c.pos1=h;
break;
}
if (chk)
st1[id][t].pb(id1[x]);
}
if (c.pos!=-1) st1[id][0].pb(c.pos);
if (c.pos1!=-1) st1[id][1].pb(c.pos1);
// cout <<l<<" "<<r<<" chk2"<<endl;
if (l==r) return c;
ll mid=(l+r)/2;
return mer(c,mer(getr(id+1,l,mid,x),getr(id+(mid-l+1)*2,mid+1,r,x)));
}
void updater(ll id,ll l,ll r,ll x,ll y,ll p,ll t)
{
if (x>r||y<l)
return ;
if (x<=l&&y>=r)
{
st1[id][t].pb(p);
return ;
}
ll mid=(l+r)/2;
updater(id+1,l,mid,x,y,p,t);
updater(id+(mid-l+1)*2,mid+1,r,x,y,p,t);
}
tk get(ll id,ll l,ll r,ll x,ll y)
{
tk c;
if (x>r||y<l)
return c;
if (x<=l&&y>=r)
return st[id];
ll mid=(l+r)/2;
return mer(get(id+1,l,mid,x,y),get(id+(mid-l+1)*2,mid+1,r,x,y));
}
void update(ll id,ll l,ll r,ll x,ll diff)
{
if (x>r||x<l)
return ;
if (l==r)
{
tk c;
st[id]=c;
if (diff==0)
st[id].pos=id1[l];
else if (diff==1)
st[id].pos1=id1[l];
return ;
}
ll mid=(l+r)/2;
update(id+1,l,mid,x,diff);
update(id+(mid-l+1)*2,mid+1,r,x,diff);
st[id]=mer(st[id+1],st[id+(mid-l+1)*2]);
}
ll pos[maxn];
ll c=1;
ll cnt=0;
ll nc[maxn];
ll nch[maxn];
ll anc[maxn][20];
ll dep[maxn];
vector<ll> adj[maxn];
ll siz[maxn];
ll nxt[maxn];
ll pre[maxn];
ll n;
ll lca(ll x,ll y)
{
if (dep[x]<dep[y])
swap(x,y);
ll kc=dep[x]-dep[y];
for (int i=19; i>=0; i--)
if (kc&(1ll<<i))
x=anc[x][i];
if (x==y)
return x;
for (int i=19; i>=0; i--)
if (anc[x][i]!=anc[y][i])
x=anc[x][i],y=anc[y][i];
return anc[x][0];
}
void dfs(ll u,ll par)
{
siz[u]=1;
anc[u][0]=par;
for (int i=1; i<=19; i++)
anc[u][i]=anc[anc[u][i-1]][i-1];
for (auto to:adj[u])
{
if (to==par)
continue;
dep[to]=dep[u]+1;
dfs(to,u);
siz[u]+=siz[to];
}
}
void hld(ll u,ll par)
{
cnt++;
id1[cnt]=u;
pos[u]=cnt;
nc[u]=c;
if (!nch[nc[u]])
nch[nc[u]]=u;
pll mx=make_pair(0,0);
for (auto to:adj[u])
{
if (to==par)
continue;
mx=max(mx,make_pair(siz[to],to));
}
if (mx.ss)
hld(mx.ss,u);
for (auto to:adj[u])
{
if (to==par||to==mx.ss)
continue;
c++;
hld(to,u);
}
}
bool chkall;
ll getnear(ll u,ll x)
{
if (dep[u]<dep[x])
swap(u,x);
ll kc=dep[u]-dep[x]-1;
for (int i=19; i>=0; i--)
if (kc&(1ll<<i))
u=anc[u][i];
return u;
}
tk get1(ll x,ll u)
{
tk a;
while (1)
{
if (nc[x]==nc[u])
{
a=mer(a,get(1,1,n,pos[u],pos[x]));
break;
}
else
{
ll h=nch[nc[x]];
a=mer(a,get(1,1,n,pos[h],pos[x]));
x=anc[h][0];
}
}
return a;
}
void update1(ll x,ll u,ll p,ll t)
{
while (1)
{
if (nc[x]==nc[u])
{
updater(1,1,n,pos[u],pos[x],p,t);
break;
}
else
{
ll h=nch[nc[x]];
updater(1,1,n,pos[h],pos[x],p,t);
x=anc[h][0];
}
}
}
void dfs1(ll u)
{
if (!chkall)
return ;
// cout <<u<<" chk1"<<endl;
col[u]=1;
ll h=nxt[u];
update(1,1,n,pos[h],1);
ll l=lca(u,h);
update1(u,l,u,1);
update1(h,l,u,1);
vector<pll> vt;
if (h==l)
{
vt.pb(make_pair(u,getnear(u,l)));
}
else
{
vt.pb(make_pair(u,l));
vt.pb(make_pair(anc[h][0],l));
}
while (1)
{
tk nw;
for (auto p:vt)
nw=mer(nw,get1(p.ff,p.ss));
if (nw.pos1!=-1)
{
/* cout <<u<<" wtf"<<endl;
cout <<nw.pos1<<" "<<nw.pos<<" wtf"<<endl;
for (auto to:vt)
{
cout <<to.ff<<" "<<to.ss<<endl;
}*/
chkall=false;
return ;
}
else if (nw.pos!=-1)
{
/*if (u==2)
{
cout <<"WTF"<<" "<<nw.pos<<" "<<pre[nw.pos]<<endl;
}*/
dfs1(pre[nw.pos]);
}
else
break;
}
while (1)
{
tk nw=getr(1,1,n,pos[u]);
/*if (u==3)
{
cout <<nw.pos<<" "<<nw.pos1<<endl;
}*/
if (nw.pos1!=-1)
{
chkall=false;
return ;
}
else if (nw.pos!=-1)
{
dfs1(nw.pos);
}
else
break;
}
col[u]=2;
update(1,1,n,pos[h],2);
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
if (fopen("t.inp","r"))
{
freopen("test.inp","r",stdin);
freopen("test.out","w",stdout);
}
ll t;
cin>> t;
while (t--)
{
chkall=true;
cin>> n;
for (int i=1; i<=n-1; i++)
{
ll x, y;
cin>>x>> y;
adj[x].pb(y);
adj[y].pb(x);
}
dfs(1,0);
c=1;
cnt=0;
hld(1,0);
ll m;
cin>> m;
for (int i=1; i<=m; i++)
{
ll x, y;
cin>>x>> y;
nxt[x]=y;
pre[y]=x;
}
for (int i=1; i<=n; i++)
{
if (pre[i])
{
ll h=pos[i];
//cout <<i<<" "<<h<<" chk1"<<endl;
update(1,1,n,h,0);
ll u=pre[i];
h=i;
ll l=lca(u,h);
// cout <<u<<" "<<h<<" "<<l<<endl;
update1(u,l,u,0);
update1(h,l,u,0);
}
}
for (int i=1; i<=n; i++)
{
if (nxt[i]&&!col[i])
{
// cout <<i<<" "<<col[i]<<" chkdfs"<<endl;
dfs1(i);
}
}
if (chkall)
cout <<"Yes"<<endl;
else
cout <<"No"<<endl;
for (int i=1; i<=n; i++)
{
adj[i].clear();
nxt[i]=0;
pre[i]=0;
col[i]=0;
nch[i]=0;
}
for (int i=1; i<=2*n; i++)
{
tk c;
st[i]=c;
st1[i][0].clear();
st1[i][1].clear();
}
}
}
/*
1
9
1 2
1 3
3 4
2 5
1 6
5 7
3 8
8 9
4
9 2
6 1
4 5
3 4
*/
Compilation message
jail.cpp:14:15: warning: overflow in conversion from 'double' to 'int' changes value from '3.0e+18' to '2147483647' [-Woverflow]
14 | const ll base=3e18;
| ^~~~
jail.cpp: In function 'int main()':
jail.cpp:317:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
317 | freopen("test.inp","r",stdin);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
jail.cpp:318:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
318 | freopen("test.out","w",stdout);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
16340 KB |
Output is correct |
2 |
Correct |
10 ms |
16304 KB |
Output is correct |
3 |
Correct |
9 ms |
16340 KB |
Output is correct |
4 |
Correct |
23 ms |
16404 KB |
Output is correct |
5 |
Correct |
38 ms |
16400 KB |
Output is correct |
6 |
Correct |
11 ms |
16420 KB |
Output is correct |
7 |
Correct |
10 ms |
16384 KB |
Output is correct |
8 |
Correct |
12 ms |
16340 KB |
Output is correct |
9 |
Correct |
64 ms |
18300 KB |
Output is correct |
10 |
Correct |
64 ms |
43168 KB |
Output is correct |
11 |
Correct |
19 ms |
16368 KB |
Output is correct |
12 |
Correct |
67 ms |
16332 KB |
Output is correct |
13 |
Correct |
207 ms |
55176 KB |
Output is correct |
14 |
Correct |
120 ms |
49208 KB |
Output is correct |
15 |
Correct |
233 ms |
50336 KB |
Output is correct |
16 |
Correct |
345 ms |
56400 KB |
Output is correct |
17 |
Correct |
279 ms |
58404 KB |
Output is correct |
18 |
Correct |
313 ms |
53896 KB |
Output is correct |
19 |
Correct |
289 ms |
57676 KB |
Output is correct |
20 |
Correct |
164 ms |
52748 KB |
Output is correct |
21 |
Correct |
218 ms |
56240 KB |
Output is correct |
22 |
Correct |
103 ms |
46732 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
16340 KB |
Output is correct |
2 |
Correct |
11 ms |
16340 KB |
Output is correct |
3 |
Correct |
10 ms |
16352 KB |
Output is correct |
4 |
Correct |
12 ms |
16408 KB |
Output is correct |
5 |
Correct |
11 ms |
16396 KB |
Output is correct |
6 |
Correct |
14 ms |
16340 KB |
Output is correct |
7 |
Correct |
12 ms |
16376 KB |
Output is correct |
8 |
Correct |
11 ms |
16340 KB |
Output is correct |
9 |
Correct |
13 ms |
16320 KB |
Output is correct |
10 |
Correct |
12 ms |
16412 KB |
Output is correct |
11 |
Correct |
10 ms |
16400 KB |
Output is correct |
12 |
Correct |
9 ms |
16340 KB |
Output is correct |
13 |
Correct |
10 ms |
16404 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
16340 KB |
Output is correct |
2 |
Correct |
11 ms |
16340 KB |
Output is correct |
3 |
Correct |
10 ms |
16352 KB |
Output is correct |
4 |
Correct |
12 ms |
16408 KB |
Output is correct |
5 |
Correct |
11 ms |
16396 KB |
Output is correct |
6 |
Correct |
14 ms |
16340 KB |
Output is correct |
7 |
Correct |
12 ms |
16376 KB |
Output is correct |
8 |
Correct |
11 ms |
16340 KB |
Output is correct |
9 |
Correct |
13 ms |
16320 KB |
Output is correct |
10 |
Correct |
12 ms |
16412 KB |
Output is correct |
11 |
Correct |
10 ms |
16400 KB |
Output is correct |
12 |
Correct |
9 ms |
16340 KB |
Output is correct |
13 |
Correct |
10 ms |
16404 KB |
Output is correct |
14 |
Correct |
9 ms |
16340 KB |
Output is correct |
15 |
Correct |
9 ms |
16336 KB |
Output is correct |
16 |
Correct |
10 ms |
16340 KB |
Output is correct |
17 |
Correct |
11 ms |
16340 KB |
Output is correct |
18 |
Correct |
11 ms |
16416 KB |
Output is correct |
19 |
Correct |
10 ms |
16328 KB |
Output is correct |
20 |
Correct |
10 ms |
16340 KB |
Output is correct |
21 |
Correct |
10 ms |
16340 KB |
Output is correct |
22 |
Correct |
10 ms |
16408 KB |
Output is correct |
23 |
Correct |
9 ms |
16340 KB |
Output is correct |
24 |
Correct |
9 ms |
16300 KB |
Output is correct |
25 |
Correct |
10 ms |
16340 KB |
Output is correct |
26 |
Correct |
10 ms |
16408 KB |
Output is correct |
27 |
Correct |
14 ms |
16388 KB |
Output is correct |
28 |
Correct |
11 ms |
16340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
16340 KB |
Output is correct |
2 |
Correct |
11 ms |
16340 KB |
Output is correct |
3 |
Correct |
10 ms |
16352 KB |
Output is correct |
4 |
Correct |
12 ms |
16408 KB |
Output is correct |
5 |
Correct |
11 ms |
16396 KB |
Output is correct |
6 |
Correct |
14 ms |
16340 KB |
Output is correct |
7 |
Correct |
12 ms |
16376 KB |
Output is correct |
8 |
Correct |
11 ms |
16340 KB |
Output is correct |
9 |
Correct |
13 ms |
16320 KB |
Output is correct |
10 |
Correct |
12 ms |
16412 KB |
Output is correct |
11 |
Correct |
10 ms |
16400 KB |
Output is correct |
12 |
Correct |
9 ms |
16340 KB |
Output is correct |
13 |
Correct |
10 ms |
16404 KB |
Output is correct |
14 |
Correct |
9 ms |
16340 KB |
Output is correct |
15 |
Correct |
9 ms |
16336 KB |
Output is correct |
16 |
Correct |
10 ms |
16340 KB |
Output is correct |
17 |
Correct |
11 ms |
16340 KB |
Output is correct |
18 |
Correct |
11 ms |
16416 KB |
Output is correct |
19 |
Correct |
10 ms |
16328 KB |
Output is correct |
20 |
Correct |
10 ms |
16340 KB |
Output is correct |
21 |
Correct |
10 ms |
16340 KB |
Output is correct |
22 |
Correct |
10 ms |
16408 KB |
Output is correct |
23 |
Correct |
9 ms |
16340 KB |
Output is correct |
24 |
Correct |
9 ms |
16300 KB |
Output is correct |
25 |
Correct |
10 ms |
16340 KB |
Output is correct |
26 |
Correct |
10 ms |
16408 KB |
Output is correct |
27 |
Correct |
14 ms |
16388 KB |
Output is correct |
28 |
Correct |
11 ms |
16340 KB |
Output is correct |
29 |
Correct |
12 ms |
16340 KB |
Output is correct |
30 |
Correct |
11 ms |
16412 KB |
Output is correct |
31 |
Correct |
14 ms |
16428 KB |
Output is correct |
32 |
Correct |
11 ms |
16340 KB |
Output is correct |
33 |
Correct |
10 ms |
16340 KB |
Output is correct |
34 |
Correct |
14 ms |
16400 KB |
Output is correct |
35 |
Correct |
13 ms |
16428 KB |
Output is correct |
36 |
Correct |
14 ms |
16452 KB |
Output is correct |
37 |
Correct |
12 ms |
16356 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
16340 KB |
Output is correct |
2 |
Correct |
11 ms |
16340 KB |
Output is correct |
3 |
Correct |
10 ms |
16352 KB |
Output is correct |
4 |
Correct |
12 ms |
16408 KB |
Output is correct |
5 |
Correct |
11 ms |
16396 KB |
Output is correct |
6 |
Correct |
14 ms |
16340 KB |
Output is correct |
7 |
Correct |
12 ms |
16376 KB |
Output is correct |
8 |
Correct |
11 ms |
16340 KB |
Output is correct |
9 |
Correct |
13 ms |
16320 KB |
Output is correct |
10 |
Correct |
12 ms |
16412 KB |
Output is correct |
11 |
Correct |
10 ms |
16400 KB |
Output is correct |
12 |
Correct |
9 ms |
16340 KB |
Output is correct |
13 |
Correct |
10 ms |
16404 KB |
Output is correct |
14 |
Correct |
9 ms |
16340 KB |
Output is correct |
15 |
Correct |
9 ms |
16336 KB |
Output is correct |
16 |
Correct |
10 ms |
16340 KB |
Output is correct |
17 |
Correct |
11 ms |
16340 KB |
Output is correct |
18 |
Correct |
11 ms |
16416 KB |
Output is correct |
19 |
Correct |
10 ms |
16328 KB |
Output is correct |
20 |
Correct |
10 ms |
16340 KB |
Output is correct |
21 |
Correct |
10 ms |
16340 KB |
Output is correct |
22 |
Correct |
10 ms |
16408 KB |
Output is correct |
23 |
Correct |
9 ms |
16340 KB |
Output is correct |
24 |
Correct |
9 ms |
16300 KB |
Output is correct |
25 |
Correct |
10 ms |
16340 KB |
Output is correct |
26 |
Correct |
10 ms |
16408 KB |
Output is correct |
27 |
Correct |
14 ms |
16388 KB |
Output is correct |
28 |
Correct |
11 ms |
16340 KB |
Output is correct |
29 |
Correct |
12 ms |
16340 KB |
Output is correct |
30 |
Correct |
11 ms |
16412 KB |
Output is correct |
31 |
Correct |
14 ms |
16428 KB |
Output is correct |
32 |
Correct |
11 ms |
16340 KB |
Output is correct |
33 |
Correct |
10 ms |
16340 KB |
Output is correct |
34 |
Correct |
14 ms |
16400 KB |
Output is correct |
35 |
Correct |
13 ms |
16428 KB |
Output is correct |
36 |
Correct |
14 ms |
16452 KB |
Output is correct |
37 |
Correct |
12 ms |
16356 KB |
Output is correct |
38 |
Correct |
69 ms |
18348 KB |
Output is correct |
39 |
Correct |
84 ms |
43212 KB |
Output is correct |
40 |
Correct |
71 ms |
18020 KB |
Output is correct |
41 |
Correct |
87 ms |
18132 KB |
Output is correct |
42 |
Correct |
58 ms |
18204 KB |
Output is correct |
43 |
Correct |
42 ms |
17484 KB |
Output is correct |
44 |
Correct |
35 ms |
16704 KB |
Output is correct |
45 |
Correct |
96 ms |
33904 KB |
Output is correct |
46 |
Correct |
95 ms |
34048 KB |
Output is correct |
47 |
Correct |
77 ms |
38736 KB |
Output is correct |
48 |
Correct |
73 ms |
38736 KB |
Output is correct |
49 |
Correct |
101 ms |
34024 KB |
Output is correct |
50 |
Correct |
84 ms |
34312 KB |
Output is correct |
51 |
Correct |
65 ms |
35228 KB |
Output is correct |
52 |
Correct |
65 ms |
35316 KB |
Output is correct |
53 |
Correct |
38 ms |
17740 KB |
Output is correct |
54 |
Correct |
136 ms |
34032 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
16436 KB |
Output is correct |
2 |
Correct |
9 ms |
16288 KB |
Output is correct |
3 |
Correct |
9 ms |
16340 KB |
Output is correct |
4 |
Correct |
9 ms |
16340 KB |
Output is correct |
5 |
Correct |
19 ms |
16372 KB |
Output is correct |
6 |
Correct |
10 ms |
16340 KB |
Output is correct |
7 |
Correct |
10 ms |
16340 KB |
Output is correct |
8 |
Correct |
9 ms |
16348 KB |
Output is correct |
9 |
Correct |
8 ms |
16340 KB |
Output is correct |
10 |
Correct |
9 ms |
16340 KB |
Output is correct |
11 |
Correct |
8 ms |
16308 KB |
Output is correct |
12 |
Correct |
13 ms |
16340 KB |
Output is correct |
13 |
Correct |
49 ms |
16432 KB |
Output is correct |
14 |
Correct |
95 ms |
16408 KB |
Output is correct |
15 |
Correct |
78 ms |
16532 KB |
Output is correct |
16 |
Correct |
134 ms |
35328 KB |
Output is correct |
17 |
Correct |
350 ms |
40256 KB |
Output is correct |
18 |
Correct |
684 ms |
44432 KB |
Output is correct |
19 |
Correct |
364 ms |
39840 KB |
Output is correct |
20 |
Correct |
183 ms |
36784 KB |
Output is correct |
21 |
Correct |
339 ms |
39888 KB |
Output is correct |
22 |
Correct |
368 ms |
40756 KB |
Output is correct |
23 |
Correct |
305 ms |
40692 KB |
Output is correct |
24 |
Correct |
735 ms |
47208 KB |
Output is correct |
25 |
Correct |
367 ms |
41072 KB |
Output is correct |
26 |
Correct |
800 ms |
47340 KB |
Output is correct |
27 |
Correct |
897 ms |
47224 KB |
Output is correct |
28 |
Correct |
683 ms |
62356 KB |
Output is correct |
29 |
Correct |
426 ms |
43856 KB |
Output is correct |
30 |
Correct |
538 ms |
48320 KB |
Output is correct |
31 |
Correct |
417 ms |
51712 KB |
Output is correct |
32 |
Correct |
520 ms |
47092 KB |
Output is correct |
33 |
Correct |
496 ms |
51656 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
16340 KB |
Output is correct |
2 |
Correct |
10 ms |
16304 KB |
Output is correct |
3 |
Correct |
9 ms |
16340 KB |
Output is correct |
4 |
Correct |
23 ms |
16404 KB |
Output is correct |
5 |
Correct |
38 ms |
16400 KB |
Output is correct |
6 |
Correct |
11 ms |
16420 KB |
Output is correct |
7 |
Correct |
10 ms |
16384 KB |
Output is correct |
8 |
Correct |
12 ms |
16340 KB |
Output is correct |
9 |
Correct |
64 ms |
18300 KB |
Output is correct |
10 |
Correct |
64 ms |
43168 KB |
Output is correct |
11 |
Correct |
19 ms |
16368 KB |
Output is correct |
12 |
Correct |
67 ms |
16332 KB |
Output is correct |
13 |
Correct |
207 ms |
55176 KB |
Output is correct |
14 |
Correct |
120 ms |
49208 KB |
Output is correct |
15 |
Correct |
233 ms |
50336 KB |
Output is correct |
16 |
Correct |
345 ms |
56400 KB |
Output is correct |
17 |
Correct |
279 ms |
58404 KB |
Output is correct |
18 |
Correct |
313 ms |
53896 KB |
Output is correct |
19 |
Correct |
289 ms |
57676 KB |
Output is correct |
20 |
Correct |
164 ms |
52748 KB |
Output is correct |
21 |
Correct |
218 ms |
56240 KB |
Output is correct |
22 |
Correct |
103 ms |
46732 KB |
Output is correct |
23 |
Correct |
10 ms |
16340 KB |
Output is correct |
24 |
Correct |
11 ms |
16340 KB |
Output is correct |
25 |
Correct |
10 ms |
16352 KB |
Output is correct |
26 |
Correct |
12 ms |
16408 KB |
Output is correct |
27 |
Correct |
11 ms |
16396 KB |
Output is correct |
28 |
Correct |
14 ms |
16340 KB |
Output is correct |
29 |
Correct |
12 ms |
16376 KB |
Output is correct |
30 |
Correct |
11 ms |
16340 KB |
Output is correct |
31 |
Correct |
13 ms |
16320 KB |
Output is correct |
32 |
Correct |
12 ms |
16412 KB |
Output is correct |
33 |
Correct |
10 ms |
16400 KB |
Output is correct |
34 |
Correct |
9 ms |
16340 KB |
Output is correct |
35 |
Correct |
10 ms |
16404 KB |
Output is correct |
36 |
Correct |
9 ms |
16340 KB |
Output is correct |
37 |
Correct |
9 ms |
16336 KB |
Output is correct |
38 |
Correct |
10 ms |
16340 KB |
Output is correct |
39 |
Correct |
11 ms |
16340 KB |
Output is correct |
40 |
Correct |
11 ms |
16416 KB |
Output is correct |
41 |
Correct |
10 ms |
16328 KB |
Output is correct |
42 |
Correct |
10 ms |
16340 KB |
Output is correct |
43 |
Correct |
10 ms |
16340 KB |
Output is correct |
44 |
Correct |
10 ms |
16408 KB |
Output is correct |
45 |
Correct |
9 ms |
16340 KB |
Output is correct |
46 |
Correct |
9 ms |
16300 KB |
Output is correct |
47 |
Correct |
10 ms |
16340 KB |
Output is correct |
48 |
Correct |
10 ms |
16408 KB |
Output is correct |
49 |
Correct |
14 ms |
16388 KB |
Output is correct |
50 |
Correct |
11 ms |
16340 KB |
Output is correct |
51 |
Correct |
12 ms |
16340 KB |
Output is correct |
52 |
Correct |
11 ms |
16412 KB |
Output is correct |
53 |
Correct |
14 ms |
16428 KB |
Output is correct |
54 |
Correct |
11 ms |
16340 KB |
Output is correct |
55 |
Correct |
10 ms |
16340 KB |
Output is correct |
56 |
Correct |
14 ms |
16400 KB |
Output is correct |
57 |
Correct |
13 ms |
16428 KB |
Output is correct |
58 |
Correct |
14 ms |
16452 KB |
Output is correct |
59 |
Correct |
12 ms |
16356 KB |
Output is correct |
60 |
Correct |
69 ms |
18348 KB |
Output is correct |
61 |
Correct |
84 ms |
43212 KB |
Output is correct |
62 |
Correct |
71 ms |
18020 KB |
Output is correct |
63 |
Correct |
87 ms |
18132 KB |
Output is correct |
64 |
Correct |
58 ms |
18204 KB |
Output is correct |
65 |
Correct |
42 ms |
17484 KB |
Output is correct |
66 |
Correct |
35 ms |
16704 KB |
Output is correct |
67 |
Correct |
96 ms |
33904 KB |
Output is correct |
68 |
Correct |
95 ms |
34048 KB |
Output is correct |
69 |
Correct |
77 ms |
38736 KB |
Output is correct |
70 |
Correct |
73 ms |
38736 KB |
Output is correct |
71 |
Correct |
101 ms |
34024 KB |
Output is correct |
72 |
Correct |
84 ms |
34312 KB |
Output is correct |
73 |
Correct |
65 ms |
35228 KB |
Output is correct |
74 |
Correct |
65 ms |
35316 KB |
Output is correct |
75 |
Correct |
38 ms |
17740 KB |
Output is correct |
76 |
Correct |
136 ms |
34032 KB |
Output is correct |
77 |
Correct |
10 ms |
16436 KB |
Output is correct |
78 |
Correct |
9 ms |
16288 KB |
Output is correct |
79 |
Correct |
9 ms |
16340 KB |
Output is correct |
80 |
Correct |
9 ms |
16340 KB |
Output is correct |
81 |
Correct |
19 ms |
16372 KB |
Output is correct |
82 |
Correct |
10 ms |
16340 KB |
Output is correct |
83 |
Correct |
10 ms |
16340 KB |
Output is correct |
84 |
Correct |
9 ms |
16348 KB |
Output is correct |
85 |
Correct |
8 ms |
16340 KB |
Output is correct |
86 |
Correct |
9 ms |
16340 KB |
Output is correct |
87 |
Correct |
8 ms |
16308 KB |
Output is correct |
88 |
Correct |
13 ms |
16340 KB |
Output is correct |
89 |
Correct |
49 ms |
16432 KB |
Output is correct |
90 |
Correct |
95 ms |
16408 KB |
Output is correct |
91 |
Correct |
78 ms |
16532 KB |
Output is correct |
92 |
Correct |
134 ms |
35328 KB |
Output is correct |
93 |
Correct |
350 ms |
40256 KB |
Output is correct |
94 |
Correct |
684 ms |
44432 KB |
Output is correct |
95 |
Correct |
364 ms |
39840 KB |
Output is correct |
96 |
Correct |
183 ms |
36784 KB |
Output is correct |
97 |
Correct |
339 ms |
39888 KB |
Output is correct |
98 |
Correct |
368 ms |
40756 KB |
Output is correct |
99 |
Correct |
305 ms |
40692 KB |
Output is correct |
100 |
Correct |
735 ms |
47208 KB |
Output is correct |
101 |
Correct |
367 ms |
41072 KB |
Output is correct |
102 |
Correct |
800 ms |
47340 KB |
Output is correct |
103 |
Correct |
897 ms |
47224 KB |
Output is correct |
104 |
Correct |
683 ms |
62356 KB |
Output is correct |
105 |
Correct |
426 ms |
43856 KB |
Output is correct |
106 |
Correct |
538 ms |
48320 KB |
Output is correct |
107 |
Correct |
417 ms |
51712 KB |
Output is correct |
108 |
Correct |
520 ms |
47092 KB |
Output is correct |
109 |
Correct |
496 ms |
51656 KB |
Output is correct |
110 |
Correct |
66 ms |
16476 KB |
Output is correct |
111 |
Correct |
45 ms |
16400 KB |
Output is correct |
112 |
Correct |
264 ms |
46288 KB |
Output is correct |
113 |
Correct |
308 ms |
46284 KB |
Output is correct |
114 |
Correct |
169 ms |
44152 KB |
Output is correct |
115 |
Correct |
69 ms |
34808 KB |
Output is correct |
116 |
Correct |
410 ms |
42504 KB |
Output is correct |
117 |
Correct |
970 ms |
47884 KB |
Output is correct |
118 |
Correct |
117 ms |
34252 KB |
Output is correct |
119 |
Correct |
112 ms |
34064 KB |
Output is correct |
120 |
Correct |
34 ms |
18664 KB |
Output is correct |
121 |
Correct |
569 ms |
44036 KB |
Output is correct |
122 |
Correct |
562 ms |
44104 KB |
Output is correct |
123 |
Correct |
335 ms |
48808 KB |
Output is correct |
124 |
Correct |
140 ms |
44260 KB |
Output is correct |
125 |
Correct |
301 ms |
48472 KB |
Output is correct |
126 |
Correct |
385 ms |
53160 KB |
Output is correct |
127 |
Correct |
406 ms |
54368 KB |
Output is correct |
128 |
Correct |
181 ms |
47428 KB |
Output is correct |
129 |
Correct |
422 ms |
60076 KB |
Output is correct |
130 |
Correct |
349 ms |
57968 KB |
Output is correct |