# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
570405 |
2022-05-29T13:34:10 Z |
jamezzz |
Jail (JOI22_jail) |
C++17 |
|
1729 ms |
499436 KB |
#include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG
#define dbg(...) printf(__VA_ARGS__);
#define getchar_unlocked getchar
#else
#define dbg(...)
#endif
#define sf scanf
#define pf printf
#define fi first
#define se second
#define pb push_back
#define sz(x) (int)x.size()
#define mnto(x,y) x=min(x,(__typeof__(x))y)
#define mxto(x,y) x=max(x,(__typeof__(x))y)
#define INF 1023456789
#define LINF 1023456789123456789
#define all(x) x.begin(), x.end()
#define disc(x) sort(all(x));x.resize(unique(all(x))-x.begin());
typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef pair<ll, ll> pll;
typedef tuple<int, int, int> iii;
typedef tuple<int, int, int, int> iiii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<pll> vll;
mt19937 rng(time(0));
#define mod 1000000007
inline int add(int a,int b){
int r=a+b;
while(r>=mod)r-=mod;
while(r<0)r+=mod;
return r;
}
inline int mult(int a,int b){
return (int)(((ll)(a*b))%mod);
}
inline int rd(){
int x=0;
char ch=getchar_unlocked();
while(!(ch&16))ch=getchar();//keep reading while current character is whitespace
while(ch&16){//this will break when ‘\n’ or ‘ ‘ is encountered
x=(x<<3)+(x<<1)+(ch&15);
ch=getchar_unlocked();
}
return x;
}
#define maxn 120005
int n,m,s[maxn],t[maxn],sid[maxn],tid[maxn];
int par[maxn][20],snode[maxn][20],tnode[maxn][20],depth[maxn],cnt;
vi AL[maxn],AL2[maxn*100];
int vis[maxn*100];
bool pos=false;
void dfs(int u){
snode[u][0]=cnt++;
tnode[u][0]=cnt++;
if(sid[u]!=-1){
AL2[sid[u]].pb(snode[u][0]);
AL2[sid[u]].pb(tnode[u][0]);
//pf("add: %d %d\n",sid[u],snode[u][0]);
}
if(tid[u]!=-1){
AL2[snode[u][0]].pb(tid[u]);
AL2[tnode[u][0]].pb(tid[u]);
//pf("add: %d %d\n",tnode[u][0],tid[u]);
}
for(int v:AL[u]){
if(v==par[u][0])continue;
par[v][0]=u;
depth[v]=depth[u]+1;
dfs(v);
}
}
void dfs2(int u){
vis[u]=1;
for(int v:AL2[u]){
if(vis[v]==0)dfs2(v);
else if(vis[v]==1)pos=false;
}
vis[u]=2;
}
inline void jump(int &x,int k,int i){
AL2[snode[x][k]].pb(i);
//pf("add: %d %d\n",snode[x][k],i);
AL2[i].pb(tnode[x][k]);
//pf("add: %d %d\n",i,tnode[x][k]);
x=par[x][k];
}
void solve(){
sf("%d",&n);
for(int i=1;i<=n;++i){
AL[i].clear();
sid[i]=tid[i]=-1;
for(int k=0;k<20;++k){
par[i][k]=0;
snode[i][k]=0;
tnode[i][k]=0;
}
}
for(int i=0;i<n-1;++i){
int a,b;sf("%d%d",&a,&b);
AL[a].pb(b);
AL[b].pb(a);
}
sf("%d",&m);
for(int i=0;i<m;++i){
sf("%d%d",&s[i],&t[i]);
sid[s[i]]=i;
tid[t[i]]=i;
}
cnt=m;
depth[1]=0;dfs(1);
for(int k=1;k<20;++k){
for(int i=1;i<=n;++i){
if(par[i][k-1]!=0){
par[i][k]=par[par[i][k-1]][k-1];
snode[i][k]=cnt++;
tnode[i][k]=cnt++;
AL2[snode[i][k-1]].pb(snode[i][k]);
AL2[snode[par[i][k-1]][k-1]].pb(snode[i][k]);
AL2[tnode[i][k]].pb(tnode[i][k-1]);
AL2[tnode[i][k]].pb(tnode[par[i][k-1]][k-1]);
}
}
}
/*
for(int i=1;i<=n;++i){
pf("%d: ",i);
for(int k=0;k<5;++k){
pf("(%d %d) ",snode[i][k],tnode[i][k]);
}
pf("\n");
}
*/
for(int i=0;i<m;++i){
int a=s[i],b=t[i];
if(depth[a]<depth[b])swap(a,b);
for(int k=19;k>=0;--k){
if(par[a][k]!=0&&depth[par[a][k]]>=depth[b]){
a=par[a][k];
}
}
for(int k=19;k>=0;--k){
if(par[a][k]!=par[b][k]){
a=par[a][k],b=par[b][k];
}
}
int l;
if(a!=b)l=par[a][0];
else l=a;
a=s[i],b=t[i];
if(a!=l){
a=par[a][0];
for(int k=19;k>=0;--k){
if(par[a][k]!=0&&depth[par[a][k]]>=depth[l]){
jump(a,k,i);
}
}
}
if(b!=l){
b=par[b][0];
for(int k=19;k>=0;--k){
if(par[b][k]!=0&&depth[par[b][k]]>=depth[l]){
jump(b,k,i);
}
}
}
if(s[i]!=l&&t[i]!=l){
AL2[snode[l][0]].pb(i);
//pf("add: %d %d\n",snode[l][0],i);
AL2[i].pb(tnode[l][0]);
//pf("add: %d %d\n",i,tnode[l][0]);
}
}
/*
for(int i=0;i<cnt;++i){
disc(AL2[i]);
}
*/
/*
for(int i=0;i<cnt;++i){
for(int j:AL2[i]){
pf("(%d %d) ",i,j);
}
if(AL2[i].size()!=0)pf("\n");
}
*/
for(int i=0;i<=cnt;++i){
vis[i]=0;
}
pos=true;
for(int i=0;i<cnt;++i){
if(!vis[i])dfs2(i);
}
if(pos)pf("Yes\n");
else pf("No\n");
for(int i=0;i<=cnt;++i)AL2[i].clear();
}
int main(){
int tc;sf("%d",&tc);
while(tc--)solve();
}
Compilation message
jail.cpp: In function 'void solve()':
jail.cpp:104:4: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
104 | sf("%d",&n);
| ^
jail.cpp:115:13: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
115 | int a,b;sf("%d%d",&a,&b);
| ^
jail.cpp:119:4: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
119 | sf("%d",&m);
| ^
jail.cpp:121:5: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
121 | sf("%d%d",&s[i],&t[i]);
| ^
jail.cpp: In function 'int main()':
jail.cpp:227:11: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
227 | int tc;sf("%d",&tc);
| ^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
134 ms |
284972 KB |
Output is correct |
2 |
Correct |
132 ms |
284896 KB |
Output is correct |
3 |
Correct |
140 ms |
284972 KB |
Output is correct |
4 |
Correct |
161 ms |
285072 KB |
Output is correct |
5 |
Correct |
195 ms |
284980 KB |
Output is correct |
6 |
Correct |
133 ms |
285312 KB |
Output is correct |
7 |
Correct |
132 ms |
285132 KB |
Output is correct |
8 |
Correct |
135 ms |
285132 KB |
Output is correct |
9 |
Correct |
332 ms |
292384 KB |
Output is correct |
10 |
Correct |
694 ms |
465244 KB |
Output is correct |
11 |
Correct |
144 ms |
284936 KB |
Output is correct |
12 |
Correct |
211 ms |
285128 KB |
Output is correct |
13 |
Correct |
735 ms |
470520 KB |
Output is correct |
14 |
Correct |
818 ms |
470580 KB |
Output is correct |
15 |
Correct |
1603 ms |
491300 KB |
Output is correct |
16 |
Correct |
1663 ms |
486452 KB |
Output is correct |
17 |
Correct |
730 ms |
474236 KB |
Output is correct |
18 |
Correct |
677 ms |
474012 KB |
Output is correct |
19 |
Correct |
736 ms |
474392 KB |
Output is correct |
20 |
Correct |
746 ms |
474184 KB |
Output is correct |
21 |
Correct |
1041 ms |
499096 KB |
Output is correct |
22 |
Correct |
731 ms |
469572 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
133 ms |
284876 KB |
Output is correct |
2 |
Correct |
136 ms |
284972 KB |
Output is correct |
3 |
Correct |
133 ms |
285224 KB |
Output is correct |
4 |
Correct |
137 ms |
285104 KB |
Output is correct |
5 |
Correct |
135 ms |
285132 KB |
Output is correct |
6 |
Correct |
137 ms |
285120 KB |
Output is correct |
7 |
Correct |
134 ms |
285144 KB |
Output is correct |
8 |
Correct |
133 ms |
285068 KB |
Output is correct |
9 |
Correct |
140 ms |
285156 KB |
Output is correct |
10 |
Correct |
135 ms |
285216 KB |
Output is correct |
11 |
Correct |
134 ms |
285028 KB |
Output is correct |
12 |
Correct |
136 ms |
285040 KB |
Output is correct |
13 |
Correct |
131 ms |
285116 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
133 ms |
284876 KB |
Output is correct |
2 |
Correct |
136 ms |
284972 KB |
Output is correct |
3 |
Correct |
133 ms |
285224 KB |
Output is correct |
4 |
Correct |
137 ms |
285104 KB |
Output is correct |
5 |
Correct |
135 ms |
285132 KB |
Output is correct |
6 |
Correct |
137 ms |
285120 KB |
Output is correct |
7 |
Correct |
134 ms |
285144 KB |
Output is correct |
8 |
Correct |
133 ms |
285068 KB |
Output is correct |
9 |
Correct |
140 ms |
285156 KB |
Output is correct |
10 |
Correct |
135 ms |
285216 KB |
Output is correct |
11 |
Correct |
134 ms |
285028 KB |
Output is correct |
12 |
Correct |
136 ms |
285040 KB |
Output is correct |
13 |
Correct |
131 ms |
285116 KB |
Output is correct |
14 |
Correct |
135 ms |
284912 KB |
Output is correct |
15 |
Correct |
129 ms |
284972 KB |
Output is correct |
16 |
Correct |
134 ms |
285120 KB |
Output is correct |
17 |
Correct |
136 ms |
285148 KB |
Output is correct |
18 |
Correct |
133 ms |
285112 KB |
Output is correct |
19 |
Correct |
133 ms |
285000 KB |
Output is correct |
20 |
Correct |
138 ms |
285132 KB |
Output is correct |
21 |
Correct |
142 ms |
285128 KB |
Output is correct |
22 |
Correct |
133 ms |
285132 KB |
Output is correct |
23 |
Correct |
145 ms |
284876 KB |
Output is correct |
24 |
Correct |
132 ms |
284972 KB |
Output is correct |
25 |
Correct |
134 ms |
285268 KB |
Output is correct |
26 |
Correct |
132 ms |
285044 KB |
Output is correct |
27 |
Correct |
134 ms |
285060 KB |
Output is correct |
28 |
Correct |
144 ms |
284932 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
133 ms |
284876 KB |
Output is correct |
2 |
Correct |
136 ms |
284972 KB |
Output is correct |
3 |
Correct |
133 ms |
285224 KB |
Output is correct |
4 |
Correct |
137 ms |
285104 KB |
Output is correct |
5 |
Correct |
135 ms |
285132 KB |
Output is correct |
6 |
Correct |
137 ms |
285120 KB |
Output is correct |
7 |
Correct |
134 ms |
285144 KB |
Output is correct |
8 |
Correct |
133 ms |
285068 KB |
Output is correct |
9 |
Correct |
140 ms |
285156 KB |
Output is correct |
10 |
Correct |
135 ms |
285216 KB |
Output is correct |
11 |
Correct |
134 ms |
285028 KB |
Output is correct |
12 |
Correct |
136 ms |
285040 KB |
Output is correct |
13 |
Correct |
131 ms |
285116 KB |
Output is correct |
14 |
Correct |
135 ms |
284912 KB |
Output is correct |
15 |
Correct |
129 ms |
284972 KB |
Output is correct |
16 |
Correct |
134 ms |
285120 KB |
Output is correct |
17 |
Correct |
136 ms |
285148 KB |
Output is correct |
18 |
Correct |
133 ms |
285112 KB |
Output is correct |
19 |
Correct |
133 ms |
285000 KB |
Output is correct |
20 |
Correct |
138 ms |
285132 KB |
Output is correct |
21 |
Correct |
142 ms |
285128 KB |
Output is correct |
22 |
Correct |
133 ms |
285132 KB |
Output is correct |
23 |
Correct |
145 ms |
284876 KB |
Output is correct |
24 |
Correct |
132 ms |
284972 KB |
Output is correct |
25 |
Correct |
134 ms |
285268 KB |
Output is correct |
26 |
Correct |
132 ms |
285044 KB |
Output is correct |
27 |
Correct |
134 ms |
285060 KB |
Output is correct |
28 |
Correct |
144 ms |
284932 KB |
Output is correct |
29 |
Correct |
139 ms |
285196 KB |
Output is correct |
30 |
Correct |
138 ms |
285200 KB |
Output is correct |
31 |
Correct |
138 ms |
285312 KB |
Output is correct |
32 |
Correct |
133 ms |
285084 KB |
Output is correct |
33 |
Correct |
135 ms |
285168 KB |
Output is correct |
34 |
Correct |
136 ms |
285100 KB |
Output is correct |
35 |
Correct |
136 ms |
285080 KB |
Output is correct |
36 |
Correct |
131 ms |
285076 KB |
Output is correct |
37 |
Correct |
135 ms |
285168 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
133 ms |
284876 KB |
Output is correct |
2 |
Correct |
136 ms |
284972 KB |
Output is correct |
3 |
Correct |
133 ms |
285224 KB |
Output is correct |
4 |
Correct |
137 ms |
285104 KB |
Output is correct |
5 |
Correct |
135 ms |
285132 KB |
Output is correct |
6 |
Correct |
137 ms |
285120 KB |
Output is correct |
7 |
Correct |
134 ms |
285144 KB |
Output is correct |
8 |
Correct |
133 ms |
285068 KB |
Output is correct |
9 |
Correct |
140 ms |
285156 KB |
Output is correct |
10 |
Correct |
135 ms |
285216 KB |
Output is correct |
11 |
Correct |
134 ms |
285028 KB |
Output is correct |
12 |
Correct |
136 ms |
285040 KB |
Output is correct |
13 |
Correct |
131 ms |
285116 KB |
Output is correct |
14 |
Correct |
135 ms |
284912 KB |
Output is correct |
15 |
Correct |
129 ms |
284972 KB |
Output is correct |
16 |
Correct |
134 ms |
285120 KB |
Output is correct |
17 |
Correct |
136 ms |
285148 KB |
Output is correct |
18 |
Correct |
133 ms |
285112 KB |
Output is correct |
19 |
Correct |
133 ms |
285000 KB |
Output is correct |
20 |
Correct |
138 ms |
285132 KB |
Output is correct |
21 |
Correct |
142 ms |
285128 KB |
Output is correct |
22 |
Correct |
133 ms |
285132 KB |
Output is correct |
23 |
Correct |
145 ms |
284876 KB |
Output is correct |
24 |
Correct |
132 ms |
284972 KB |
Output is correct |
25 |
Correct |
134 ms |
285268 KB |
Output is correct |
26 |
Correct |
132 ms |
285044 KB |
Output is correct |
27 |
Correct |
134 ms |
285060 KB |
Output is correct |
28 |
Correct |
144 ms |
284932 KB |
Output is correct |
29 |
Correct |
139 ms |
285196 KB |
Output is correct |
30 |
Correct |
138 ms |
285200 KB |
Output is correct |
31 |
Correct |
138 ms |
285312 KB |
Output is correct |
32 |
Correct |
133 ms |
285084 KB |
Output is correct |
33 |
Correct |
135 ms |
285168 KB |
Output is correct |
34 |
Correct |
136 ms |
285100 KB |
Output is correct |
35 |
Correct |
136 ms |
285080 KB |
Output is correct |
36 |
Correct |
131 ms |
285076 KB |
Output is correct |
37 |
Correct |
135 ms |
285168 KB |
Output is correct |
38 |
Correct |
368 ms |
292864 KB |
Output is correct |
39 |
Correct |
715 ms |
466376 KB |
Output is correct |
40 |
Correct |
332 ms |
293884 KB |
Output is correct |
41 |
Correct |
213 ms |
289920 KB |
Output is correct |
42 |
Correct |
202 ms |
291720 KB |
Output is correct |
43 |
Correct |
306 ms |
293688 KB |
Output is correct |
44 |
Correct |
146 ms |
285900 KB |
Output is correct |
45 |
Correct |
462 ms |
376340 KB |
Output is correct |
46 |
Correct |
476 ms |
376464 KB |
Output is correct |
47 |
Correct |
756 ms |
452820 KB |
Output is correct |
48 |
Correct |
766 ms |
452668 KB |
Output is correct |
49 |
Correct |
527 ms |
413892 KB |
Output is correct |
50 |
Correct |
525 ms |
413892 KB |
Output is correct |
51 |
Correct |
620 ms |
438920 KB |
Output is correct |
52 |
Correct |
626 ms |
440060 KB |
Output is correct |
53 |
Correct |
162 ms |
290936 KB |
Output is correct |
54 |
Correct |
553 ms |
367516 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
132 ms |
284876 KB |
Output is correct |
2 |
Correct |
136 ms |
284900 KB |
Output is correct |
3 |
Correct |
132 ms |
284876 KB |
Output is correct |
4 |
Correct |
134 ms |
284876 KB |
Output is correct |
5 |
Correct |
143 ms |
284868 KB |
Output is correct |
6 |
Correct |
132 ms |
285092 KB |
Output is correct |
7 |
Correct |
134 ms |
285008 KB |
Output is correct |
8 |
Correct |
132 ms |
285080 KB |
Output is correct |
9 |
Correct |
137 ms |
285096 KB |
Output is correct |
10 |
Correct |
133 ms |
285020 KB |
Output is correct |
11 |
Correct |
153 ms |
284876 KB |
Output is correct |
12 |
Correct |
136 ms |
285124 KB |
Output is correct |
13 |
Correct |
178 ms |
285048 KB |
Output is correct |
14 |
Correct |
187 ms |
285008 KB |
Output is correct |
15 |
Correct |
179 ms |
285000 KB |
Output is correct |
16 |
Correct |
450 ms |
354416 KB |
Output is correct |
17 |
Correct |
688 ms |
366276 KB |
Output is correct |
18 |
Correct |
875 ms |
382120 KB |
Output is correct |
19 |
Correct |
481 ms |
356176 KB |
Output is correct |
20 |
Correct |
498 ms |
355200 KB |
Output is correct |
21 |
Correct |
489 ms |
355400 KB |
Output is correct |
22 |
Correct |
589 ms |
362484 KB |
Output is correct |
23 |
Correct |
516 ms |
360224 KB |
Output is correct |
24 |
Correct |
555 ms |
360516 KB |
Output is correct |
25 |
Correct |
522 ms |
361260 KB |
Output is correct |
26 |
Correct |
517 ms |
360892 KB |
Output is correct |
27 |
Correct |
498 ms |
349856 KB |
Output is correct |
28 |
Correct |
514 ms |
358208 KB |
Output is correct |
29 |
Correct |
483 ms |
352344 KB |
Output is correct |
30 |
Correct |
445 ms |
346248 KB |
Output is correct |
31 |
Correct |
432 ms |
347424 KB |
Output is correct |
32 |
Correct |
442 ms |
344516 KB |
Output is correct |
33 |
Correct |
472 ms |
347476 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
134 ms |
284972 KB |
Output is correct |
2 |
Correct |
132 ms |
284896 KB |
Output is correct |
3 |
Correct |
140 ms |
284972 KB |
Output is correct |
4 |
Correct |
161 ms |
285072 KB |
Output is correct |
5 |
Correct |
195 ms |
284980 KB |
Output is correct |
6 |
Correct |
133 ms |
285312 KB |
Output is correct |
7 |
Correct |
132 ms |
285132 KB |
Output is correct |
8 |
Correct |
135 ms |
285132 KB |
Output is correct |
9 |
Correct |
332 ms |
292384 KB |
Output is correct |
10 |
Correct |
694 ms |
465244 KB |
Output is correct |
11 |
Correct |
144 ms |
284936 KB |
Output is correct |
12 |
Correct |
211 ms |
285128 KB |
Output is correct |
13 |
Correct |
735 ms |
470520 KB |
Output is correct |
14 |
Correct |
818 ms |
470580 KB |
Output is correct |
15 |
Correct |
1603 ms |
491300 KB |
Output is correct |
16 |
Correct |
1663 ms |
486452 KB |
Output is correct |
17 |
Correct |
730 ms |
474236 KB |
Output is correct |
18 |
Correct |
677 ms |
474012 KB |
Output is correct |
19 |
Correct |
736 ms |
474392 KB |
Output is correct |
20 |
Correct |
746 ms |
474184 KB |
Output is correct |
21 |
Correct |
1041 ms |
499096 KB |
Output is correct |
22 |
Correct |
731 ms |
469572 KB |
Output is correct |
23 |
Correct |
133 ms |
284876 KB |
Output is correct |
24 |
Correct |
136 ms |
284972 KB |
Output is correct |
25 |
Correct |
133 ms |
285224 KB |
Output is correct |
26 |
Correct |
137 ms |
285104 KB |
Output is correct |
27 |
Correct |
135 ms |
285132 KB |
Output is correct |
28 |
Correct |
137 ms |
285120 KB |
Output is correct |
29 |
Correct |
134 ms |
285144 KB |
Output is correct |
30 |
Correct |
133 ms |
285068 KB |
Output is correct |
31 |
Correct |
140 ms |
285156 KB |
Output is correct |
32 |
Correct |
135 ms |
285216 KB |
Output is correct |
33 |
Correct |
134 ms |
285028 KB |
Output is correct |
34 |
Correct |
136 ms |
285040 KB |
Output is correct |
35 |
Correct |
131 ms |
285116 KB |
Output is correct |
36 |
Correct |
135 ms |
284912 KB |
Output is correct |
37 |
Correct |
129 ms |
284972 KB |
Output is correct |
38 |
Correct |
134 ms |
285120 KB |
Output is correct |
39 |
Correct |
136 ms |
285148 KB |
Output is correct |
40 |
Correct |
133 ms |
285112 KB |
Output is correct |
41 |
Correct |
133 ms |
285000 KB |
Output is correct |
42 |
Correct |
138 ms |
285132 KB |
Output is correct |
43 |
Correct |
142 ms |
285128 KB |
Output is correct |
44 |
Correct |
133 ms |
285132 KB |
Output is correct |
45 |
Correct |
145 ms |
284876 KB |
Output is correct |
46 |
Correct |
132 ms |
284972 KB |
Output is correct |
47 |
Correct |
134 ms |
285268 KB |
Output is correct |
48 |
Correct |
132 ms |
285044 KB |
Output is correct |
49 |
Correct |
134 ms |
285060 KB |
Output is correct |
50 |
Correct |
144 ms |
284932 KB |
Output is correct |
51 |
Correct |
139 ms |
285196 KB |
Output is correct |
52 |
Correct |
138 ms |
285200 KB |
Output is correct |
53 |
Correct |
138 ms |
285312 KB |
Output is correct |
54 |
Correct |
133 ms |
285084 KB |
Output is correct |
55 |
Correct |
135 ms |
285168 KB |
Output is correct |
56 |
Correct |
136 ms |
285100 KB |
Output is correct |
57 |
Correct |
136 ms |
285080 KB |
Output is correct |
58 |
Correct |
131 ms |
285076 KB |
Output is correct |
59 |
Correct |
135 ms |
285168 KB |
Output is correct |
60 |
Correct |
368 ms |
292864 KB |
Output is correct |
61 |
Correct |
715 ms |
466376 KB |
Output is correct |
62 |
Correct |
332 ms |
293884 KB |
Output is correct |
63 |
Correct |
213 ms |
289920 KB |
Output is correct |
64 |
Correct |
202 ms |
291720 KB |
Output is correct |
65 |
Correct |
306 ms |
293688 KB |
Output is correct |
66 |
Correct |
146 ms |
285900 KB |
Output is correct |
67 |
Correct |
462 ms |
376340 KB |
Output is correct |
68 |
Correct |
476 ms |
376464 KB |
Output is correct |
69 |
Correct |
756 ms |
452820 KB |
Output is correct |
70 |
Correct |
766 ms |
452668 KB |
Output is correct |
71 |
Correct |
527 ms |
413892 KB |
Output is correct |
72 |
Correct |
525 ms |
413892 KB |
Output is correct |
73 |
Correct |
620 ms |
438920 KB |
Output is correct |
74 |
Correct |
626 ms |
440060 KB |
Output is correct |
75 |
Correct |
162 ms |
290936 KB |
Output is correct |
76 |
Correct |
553 ms |
367516 KB |
Output is correct |
77 |
Correct |
132 ms |
284876 KB |
Output is correct |
78 |
Correct |
136 ms |
284900 KB |
Output is correct |
79 |
Correct |
132 ms |
284876 KB |
Output is correct |
80 |
Correct |
134 ms |
284876 KB |
Output is correct |
81 |
Correct |
143 ms |
284868 KB |
Output is correct |
82 |
Correct |
132 ms |
285092 KB |
Output is correct |
83 |
Correct |
134 ms |
285008 KB |
Output is correct |
84 |
Correct |
132 ms |
285080 KB |
Output is correct |
85 |
Correct |
137 ms |
285096 KB |
Output is correct |
86 |
Correct |
133 ms |
285020 KB |
Output is correct |
87 |
Correct |
153 ms |
284876 KB |
Output is correct |
88 |
Correct |
136 ms |
285124 KB |
Output is correct |
89 |
Correct |
178 ms |
285048 KB |
Output is correct |
90 |
Correct |
187 ms |
285008 KB |
Output is correct |
91 |
Correct |
179 ms |
285000 KB |
Output is correct |
92 |
Correct |
450 ms |
354416 KB |
Output is correct |
93 |
Correct |
688 ms |
366276 KB |
Output is correct |
94 |
Correct |
875 ms |
382120 KB |
Output is correct |
95 |
Correct |
481 ms |
356176 KB |
Output is correct |
96 |
Correct |
498 ms |
355200 KB |
Output is correct |
97 |
Correct |
489 ms |
355400 KB |
Output is correct |
98 |
Correct |
589 ms |
362484 KB |
Output is correct |
99 |
Correct |
516 ms |
360224 KB |
Output is correct |
100 |
Correct |
555 ms |
360516 KB |
Output is correct |
101 |
Correct |
522 ms |
361260 KB |
Output is correct |
102 |
Correct |
517 ms |
360892 KB |
Output is correct |
103 |
Correct |
498 ms |
349856 KB |
Output is correct |
104 |
Correct |
514 ms |
358208 KB |
Output is correct |
105 |
Correct |
483 ms |
352344 KB |
Output is correct |
106 |
Correct |
445 ms |
346248 KB |
Output is correct |
107 |
Correct |
432 ms |
347424 KB |
Output is correct |
108 |
Correct |
442 ms |
344516 KB |
Output is correct |
109 |
Correct |
472 ms |
347476 KB |
Output is correct |
110 |
Correct |
199 ms |
286160 KB |
Output is correct |
111 |
Correct |
178 ms |
285660 KB |
Output is correct |
112 |
Correct |
1523 ms |
491228 KB |
Output is correct |
113 |
Correct |
1042 ms |
457652 KB |
Output is correct |
114 |
Correct |
973 ms |
424592 KB |
Output is correct |
115 |
Correct |
209 ms |
329952 KB |
Output is correct |
116 |
Correct |
661 ms |
371124 KB |
Output is correct |
117 |
Correct |
1020 ms |
397188 KB |
Output is correct |
118 |
Correct |
644 ms |
365288 KB |
Output is correct |
119 |
Correct |
529 ms |
365204 KB |
Output is correct |
120 |
Correct |
184 ms |
292684 KB |
Output is correct |
121 |
Correct |
923 ms |
384032 KB |
Output is correct |
122 |
Correct |
858 ms |
380612 KB |
Output is correct |
123 |
Correct |
1132 ms |
462620 KB |
Output is correct |
124 |
Correct |
1114 ms |
462640 KB |
Output is correct |
125 |
Correct |
1160 ms |
463456 KB |
Output is correct |
126 |
Correct |
1729 ms |
489452 KB |
Output is correct |
127 |
Correct |
1382 ms |
498328 KB |
Output is correct |
128 |
Correct |
1234 ms |
499436 KB |
Output is correct |
129 |
Correct |
1170 ms |
474692 KB |
Output is correct |
130 |
Correct |
1526 ms |
494656 KB |
Output is correct |