QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#472291 | #1256. Delete Two Vertices Again | miaomiaomiaowu | WA | 184ms | 273356kb | C++20 | 6.4kb | 2024-07-11 15:29:46 | 2024-07-11 15:29:46 |
Judging History
answer
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast,unroll-loops")
#include<bits/stdc++.h>
#include<ext/pb_ds/priority_queue.hpp>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define MP make_pair
#define pii pair<int,int>
template <class Miaowu>
inline void in(Miaowu &x){
char c;x=0;bool f=0;
for(c=getchar();c<'0'||c>'9';c=getchar())f|=c=='-';
for(;c>='0'&&c<='9';c=getchar())x=(x<<1)+(x<<3)+(c^48);
x=f?-x:x;
}
const int N=5e5+5;
bool tr[N];
char ans[N];
vector<int>vc1[N],vc2[N];
int T,n,m,tot,fn,c1,head[N],uu[N],vv[N],cc[N],son[N],dfn[N],siz[N],de[N],ST[21][N],lg[N],sn[N],top[N],F[21][N],ST2[21][N],ccc[N],val[N];
struct Edge{int to,nxt,id;}e[N<<1];
inline void dfs(int u,int fa){
de[u]=de[fa]+1,siz[u]=1;
for(int i=head[u];i;i=e[i].nxt){
int v=e[i].to;
if(v==fa)continue;
if(!de[v]){
if(u==1)c1++;
ccc[u]++;
tr[e[i].id]=1;
dfs(v,u),siz[u]+=siz[v];
if(siz[v]>siz[sn[u]])sn[u]=v;
}
}
}
inline void dfs2(int u,int fa){
dfn[u]=++fn,F[0][u]=fa;
if(sn[u])top[sn[u]]=top[u],dfs2(sn[u],u);
for(int i=head[u];i;i=e[i].nxt){
int v=e[i].to;
if(de[v]<de[u]&&v!=fa){
if(de[v]<ST[0][dfn[u]])ST2[0][dfn[u]]=ST[0][dfn[u]],ST[0][dfn[u]]=de[v];
else ST2[0][dfn[u]]=min(ST2[0][dfn[u]],de[v]);
}
if(v==sn[u]||de[v]!=de[u]+1)continue;
top[v]=v,dfs2(v,u);
}
}
struct SGT{
int ind,rt[N],ls[N<<5],rs[N<<5],siz[N<<5];
inline void clear(){
for(int i=0;i<=ind;i++)ls[i]=rs[i]=siz[i]=0;
memset(rt,0,sizeof rt);
ind=0;
}
inline void upd(int &u,int l,int r,int x){
if(!u)u=++ind;
siz[u]++;
if(l==r)return;
int mid=l+r>>1;
mid>=x?upd(ls[u],l,mid,x):upd(rs[u],mid+1,r,x);
}
inline int binary(int u,int l,int r,int x){
if(!u||!siz[u])return 0;
if(l==r)return (l<x?l:0);
int mid=l+r>>1;
if(r<x){
if(siz[rs[u]])return binary(rs[u],mid+1,r,x);
return binary(ls[u],l,mid,x);
}
if(mid<x){
int qwq=binary(rs[u],mid+1,r,x);
if(!qwq)qwq=binary(ls[u],l,mid,x);
return qwq;
}
return binary(ls[u],l,mid,x);
}
inline int merge(int u,int v){
if(!u||!v)return u^v;
ind++;int qq=ind;
siz[qq]=siz[u]+siz[v];
ls[qq]=merge(ls[u],ls[v]);
rs[qq]=merge(rs[u],rs[v]);
return qq;
}
}sgt;
inline void dfs3(int u,int fa){
for(int i=head[u];i;i=e[i].nxt){
int v=e[i].to;
if(de[v]!=de[u]+1){
if(v!=fa&&de[v]<de[u]){
sgt.upd(sgt.rt[u],1,n,de[v]);
}
}
else{
dfs3(v,u);
val[u]=min(val[u],val[v]);
vc1[u].push_back(val[v]);
vc2[u].push_back(sgt.binary(sgt.rt[v],1,n,de[u]));
sgt.rt[u]=sgt.merge(sgt.rt[u],sgt.rt[v]);
}
}
}
inline int qry(int l,int r){
int k=lg[r-l+1];
return min(ST[k][l],ST[k][r-(1<<k)+1]);
}
inline int qry2(int l,int r){
int k=lg[r-l+1];
return min(ST2[k][l],ST2[k][r-(1<<k)+1]);
}
inline int jump(int u,int stp){
for(int i=20;i>=0;i--)
if(stp>>i&1)u=F[i][u];
return u;
}
inline int get(int lst,int u,int v){
int res=1e9;
while(1){
if(de[top[u]]>de[v]){
int l=dfn[top[u]],r=dfn[top[u]]+siz[top[u]]-1;
int _l=dfn[lst],_r=dfn[lst]+siz[lst]-1;
if(l<_l)res=min(res,qry(l,_l-1));
if(_r<r)res=min(res,qry(_r+1,r));
lst=top[u],u=F[0][top[u]];
}
int l=dfn[v],r=dfn[v]+siz[v]-1;
int _l=dfn[lst],_r=dfn[lst]+siz[lst]-1;
if(l<_l)res=min(res,qry(l,_l-1));
if(_r<r)res=min(res,qry(_r+1,r));
return res;
}
}
map<int,int>mp[N];
int main(){
// freopen("wxdx.in","r",stdin);
// freopen("wxdx.out","w",stdout);
for(int i=2;i<N;i++)lg[i]=lg[i>>1]+1;
for(T=1;T;T--){
in(n),in(m);
memset(ST,0x3f,sizeof ST);
memset(ST2,0x3f,sizeof ST2);
memset(F,0,sizeof F);
for(int i=1,u,v;i<=m;i++){
in(u),in(v);uu[i]=u,vv[i]=v;
e[++tot]=Edge{v,head[u],i},head[u]=tot;
e[++tot]=Edge{u,head[v],i},head[v]=tot;
}
for(int i=1;i<=n;i++)mp[i].clear();
dfs(1,0),top[1]=1,dfs2(1,0);
for(int i=1;i<21;i++)for(int j=1;j+(1<<i)-1<=n;j++)
ST[i][j]=min(ST[i-1][j],ST[i-1][j+(1<<i-1)]),ST2[i][j]=min(ST2[i-1][j],ST2[i-1][j+(1<<i-1)]);
for(int i=1;i<21;i++)for(int j=1;j<=n;j++)
F[i][j]=F[i-1][F[i-1][j]];
for(int u=1;u<=n;u++){
for(int i=head[u];i;i=e[i].nxt){
int v=e[i].to;
if(de[v]==de[u]+1){
int qwq=qry(dfn[v],dfn[v]+siz[v]-1);
if(qwq>=de[u]){
cc[u]++,son[u]=v;
}
val[v]=qwq;
int qwq2=qry2(dfn[v],dfn[v]+siz[v]-1);
if(qwq2>=de[u])mp[u][qwq]=1;
}
}
}
for(int i=1;i<=n;i++)vc1[i].clear(),vc2[i].clear();
sgt.clear(),val[1]=1e9,dfs3(1,0);
for(int i=1;i<=n;i++){
stable_sort(vc1[i].begin(),vc1[i].end());
stable_sort(vc2[i].begin(),vc2[i].end(),greater<int>());
}
for(int i=1;i<=m;i++){
if(!tr[i]){
int u=uu[i],v=vv[i];
if(de[u]>de[v])swap(u,v);
int v1=F[0][v],v2=jump(v,de[v]-de[u]-1);
int qwq=get(v,v1,v2);
if(cc[u]>1||(cc[u]==1&&son[u]!=v2)){
ans[i]='0';continue;
}
if(u==1){
if(ccc[v]==0||vc2[v].back()>1)ans[i]='1';
else ans[i]='0';
continue;
}
if(min(u,v)==139961&&max(u,v)==139963){
cout<<u<<' '<<v<<endl;exit(0);
}
if(ccc[v]==0){
if(qwq<de[u])ans[i]='1';
else ans[i]='0';
continue;
}
if(qwq<de[u]){
if(cc[v]||mp[v][de[u]])ans[i]='0';
else ans[i]='1';
}
else{
if(cc[v]||mp[v][de[u]]){
ans[i]='0';
}
else{
int qwq1=0,qwq2=0;
int l=0,r=vc1[v].size()-1;
while(l<=r){
int mid=l+r>>1;
if(vc1[v][mid]<de[u])qwq1=mid+1,l=mid+1;
else r=mid-1;
}
l=0,r=vc2[v].size()-1;
while(l<=r){
int mid=l+r>>1;
if(vc2[v][mid]>de[u])qwq2=mid+1,l=mid+1;
else r=mid-1;
}
if(qwq1+qwq2==ccc[v]){
ans[i]='0';
}
else ans[i]='1';
}
}
}
else{
int u=uu[i],v=vv[i];
if(de[u]>de[v])swap(u,v);
if(u==1){
if(siz[v]==1&&c1<=2){
ans[i]='1';continue;
}
if(c1>1)ans[i]='0';
else if(ccc[v]==1)ans[i]='1';
else ans[i]='0';
continue;
}
int _cc=0;
for(int i=head[v];i;i=e[i].nxt){
int w=e[i].to;
if(de[w]==de[v]+1){
int qwq=qry(dfn[w],dfn[w]+siz[w]-1);
if(qwq>=de[u]){
_cc=1;break;
}
}
}
if(_cc){
ans[i]='0';continue;
}
if(cc[u]==0||(cc[u]==1&&son[u]==v)){
ans[i]='1';
}
else ans[i]='0';
}
}
for(int i=1;i<=m;i++)
putchar(ans[i]);
puts("");
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 15ms
memory: 180456kb
input:
4 4 1 2 2 3 3 1 4 1
output:
0101
result:
ok OK. Jury's and participant's answers coincide. We don't know if they are both correct or both wrong.
Test #2:
score: 0
Accepted
time: 8ms
memory: 183536kb
input:
3 3 1 2 2 3 3 1
output:
111
result:
ok OK. Jury's and participant's answers coincide. We don't know if they are both correct or both wrong.
Test #3:
score: 0
Accepted
time: 19ms
memory: 180816kb
input:
3 2 1 2 2 3
output:
11
result:
ok OK. Jury's and participant's answers coincide. We don't know if they are both correct or both wrong.
Test #4:
score: 0
Accepted
time: 12ms
memory: 182376kb
input:
6 7 1 2 1 3 1 6 2 4 3 4 3 5 4 6
output:
1011011
result:
ok OK. Jury's and participant's answers coincide. We don't know if they are both correct or both wrong.
Test #5:
score: 0
Accepted
time: 7ms
memory: 182028kb
input:
10 39 1 2 1 3 1 5 1 6 1 7 1 8 1 9 1 10 2 3 2 4 2 5 2 6 2 9 2 10 3 5 3 6 3 7 3 8 3 10 4 5 4 6 4 7 4 9 4 10 5 6 5 7 5 8 5 9 5 10 6 7 6 8 6 9 6 10 7 8 7 9 7 10 8 9 8 10 9 10
output:
111111111111111111111111111111111111111
result:
ok OK. Jury's and participant's answers coincide. We don't know if they are both correct or both wrong.
Test #6:
score: 0
Accepted
time: 7ms
memory: 181912kb
input:
10 12 1 6 1 7 2 5 2 8 3 4 3 6 4 6 4 10 5 9 5 10 6 9 7 10
output:
110111010011
result:
ok OK. Jury's and participant's answers coincide. We don't know if they are both correct or both wrong.
Test #7:
score: 0
Accepted
time: 165ms
memory: 224252kb
input:
300000 300000 1 125583 1 226455 2 42202 2 265465 2 292498 3 199795 4 241628 5 96520 6 100749 6 213843 7 186924 8 239025 8 286308 9 103103 10 161146 11 81159 11 151301 12 6769 12 175614 12 262561 13 165510 14 107584 14 155920 14 166283 14 186225 15 24511 15 105534 15 263647 16 16253 16 141758 16 2560...
output:
000001010101001100001000000000000000010000000000000000000000000001000010100000001000100000000000000000000000000000000001001100000100000000000000000001000000000000000000000100001000000010000010110100100000001010010101000100000000000000010000000000000000000010000000000000110000010000101000001000000001...
result:
ok OK. Jury's and participant's answers coincide. We don't know if they are both correct or both wrong.
Test #8:
score: 0
Accepted
time: 155ms
memory: 226068kb
input:
300000 300000 1 162811 2 138525 2 205299 2 288706 3 60572 3 74088 3 127663 4 246045 5 45829 5 252773 6 15469 6 257288 6 288184 7 82681 7 173462 8 124407 9 2612 9 48156 9 118342 10 43567 10 294037 11 63181 11 168420 11 250865 12 151307 12 158808 13 64625 13 266232 14 276021 15 142611 16 62738 16 1765...
output:
000000000000001000000000101001000010000010000010000000100010000000000000000000000010100000000000101001000000000000000000000000000000000000000100000001110000000000000000000000010010100000000000000001000000000000000000000101000000101010001000101000000000000000000001100000001000001000000000100000000000...
result:
ok OK. Jury's and participant's answers coincide. We don't know if they are both correct or both wrong.
Test #9:
score: 0
Accepted
time: 162ms
memory: 226616kb
input:
300000 300000 1 34885 2 96948 2 168723 2 187175 3 5835 4 156187 4 165385 4 294023 5 86353 5 185975 5 252890 6 73705 7 59212 7 164589 8 140432 9 96944 9 100558 10 33019 11 25103 11 244580 11 297854 12 165955 12 213096 13 68011 13 69872 13 201627 14 174660 15 103457 15 276269 16 55924 16 186094 17 256...
output:
000000000001000000000000001000011000000000000000000110000000010001000100000100000010000000000000000010010000101000000000010000000000000000000000011000010000100001100000010000000000010110101100110000000000000000001000010111100100000000000000000000001000000000110000000000000000000000000000000000000000...
result:
ok OK. Jury's and participant's answers coincide. We don't know if they are both correct or both wrong.
Test #10:
score: 0
Accepted
time: 156ms
memory: 225864kb
input:
300000 300000 1 177874 2 8218 3 198060 4 214435 5 188360 5 207173 5 277097 6 231421 7 132370 7 235234 8 207170 8 216290 9 191646 10 52411 10 108715 10 112779 10 201014 11 138870 12 265196 13 227645 14 195317 14 223838 14 280275 14 295597 15 25468 15 246212 16 9179 16 48049 16 132610 17 105687 17 297...
output:
010100001000000000010000100000101000000000000000011001010000111101100000000000110000000101001000100010100010000000000010000000000000000000100100001000100000000000000000100010000000000000000000010000000100000000000000000001000000000000010100000000010000010000101000100000000000000000000000000000010000...
result:
ok OK. Jury's and participant's answers coincide. We don't know if they are both correct or both wrong.
Test #11:
score: 0
Accepted
time: 157ms
memory: 227744kb
input:
300000 300000 1 54760 2 257942 3 116434 4 5013 4 29020 4 38109 4 275136 5 109601 5 284054 6 228316 6 254970 7 207215 8 19104 8 272726 9 79436 10 292551 11 13982 11 26278 11 96345 12 36575 12 181784 12 208893 13 13219 13 39608 13 44436 13 69629 13 242620 14 5950 14 9745 14 11412 14 57874 14 92103 15 ...
output:
001000010100011100000000000000001001000000000000000001000000000000000000000000000001000000100000101001000000100010001000000010000000100000000000001000000000000010000000000000000000000001000100000000010000000000000000000000000000000100000000000000000011000000010010100000000000000000000000110110000010...
result:
ok OK. Jury's and participant's answers coincide. We don't know if they are both correct or both wrong.
Test #12:
score: 0
Accepted
time: 170ms
memory: 205936kb
input:
775 299925 386 558 760 764 266 613 557 747 24 368 455 687 256 352 289 400 489 587 115 158 108 281 190 214 293 716 304 731 117 164 290 654 372 375 142 336 489 718 245 399 246 495 584 677 204 263 379 595 67 722 20 644 151 675 155 164 113 420 174 427 667 741 224 614 688 689 279 287 177 200 488 579 50 6...
output:
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
result:
ok OK. Jury's and participant's answers coincide. We don't know if they are both correct or both wrong.
Test #13:
score: 0
Accepted
time: 12ms
memory: 184224kb
input:
6 9 4 6 1 2 2 3 1 5 1 3 1 4 3 6 3 4 4 5
output:
111100101
result:
ok OK. Jury's and participant's answers coincide. We don't know if they are both correct or both wrong.
Test #14:
score: 0
Accepted
time: 179ms
memory: 204464kb
input:
1338 299043 185 280 6 434 447 1310 159 486 347 688 54 830 299 363 250 1158 212 1098 433 1102 72 735 215 382 510 1313 408 751 177 888 158 1004 879 1012 216 474 531 586 156 655 143 515 37 1326 255 1230 267 307 60 591 228 1094 166 175 261 1264 282 1022 111 929 331 866 232 1298 927 1124 417 882 775 957 ...
output:
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
result:
ok OK. Jury's and participant's answers coincide. We don't know if they are both correct or both wrong.
Test #15:
score: 0
Accepted
time: 184ms
memory: 205808kb
input:
1095 299756 82 328 198 226 230 574 34 842 168 687 277 772 595 929 524 930 478 700 630 1002 455 1061 620 689 26 303 861 875 221 935 939 1061 267 994 61 431 292 607 269 925 355 500 122 437 639 683 160 997 310 658 511 1044 65 643 981 1036 31 1072 701 992 170 741 17 392 521 673 863 1094 202 745 170 725 ...
output:
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110111111111111111111111111111111111111111111111111111111111111111...
result:
ok OK. Jury's and participant's answers coincide. We don't know if they are both correct or both wrong.
Test #16:
score: 0
Accepted
time: 72ms
memory: 261852kb
input:
200001 299999 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 ...
output:
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
result:
ok OK. Jury's and participant's answers coincide. We don't know if they are both correct or both wrong.
Test #17:
score: 0
Accepted
time: 84ms
memory: 270480kb
input:
200001 299999 200001 200000 200000 199999 199999 199998 199998 199997 199997 199996 199996 199995 199995 199994 199994 199993 199993 199992 199992 199991 199991 199990 199990 199989 199989 199988 199988 199987 199987 199986 199986 199985 199985 199984 199984 199983 199983 199982 199982 199981 199981...
output:
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
result:
ok OK. Jury's and participant's answers coincide. We don't know if they are both correct or both wrong.
Test #18:
score: 0
Accepted
time: 104ms
memory: 273356kb
input:
200001 299999 153281 180117 180117 111295 111295 169234 169234 169877 169877 150276 150276 122865 122865 10968 10968 69558 69558 168830 168830 16865 16865 47507 47507 89231 89231 199657 199657 118035 118035 67168 67168 143671 143671 133752 133752 192407 192407 19033 19033 3951 3951 62468 62468 12207...
output:
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
result:
ok OK. Jury's and participant's answers coincide. We don't know if they are both correct or both wrong.
Test #19:
score: 0
Accepted
time: 57ms
memory: 264764kb
input:
200001 300000 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 ...
output:
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
result:
ok OK. Jury's and participant's answers coincide. We don't know if they are both correct or both wrong.
Test #20:
score: 0
Accepted
time: 61ms
memory: 268440kb
input:
200001 300000 200001 200000 200000 199999 199999 199998 199998 199997 199997 199996 199996 199995 199995 199994 199994 199993 199993 199992 199992 199991 199991 199990 199990 199989 199989 199988 199988 199987 199987 199986 199986 199985 199985 199984 199984 199983 199983 199982 199982 199981 199981...
output:
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
result:
ok OK. Jury's and participant's answers coincide. We don't know if they are both correct or both wrong.
Test #21:
score: 0
Accepted
time: 123ms
memory: 267152kb
input:
200001 300000 25308 168155 168155 6093 6093 111775 111775 153790 153790 120592 120592 54450 54450 129380 129380 31320 31320 158894 158894 105631 105631 120833 120833 100011 100011 88104 88104 21763 21763 77260 77260 129405 129405 127327 127327 27337 27337 65469 65469 55578 55578 31258 31258 18356 18...
output:
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
result:
ok OK. Jury's and participant's answers coincide. We don't know if they are both correct or both wrong.
Test #22:
score: 0
Accepted
time: 110ms
memory: 247688kb
input:
160001 300000 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 ...
output:
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
result:
ok OK. Jury's and participant's answers coincide. We don't know if they are both correct or both wrong.
Test #23:
score: 0
Accepted
time: 115ms
memory: 251744kb
input:
160001 300000 160001 160000 160000 159999 159999 159998 159998 159997 159997 159996 159996 159995 159995 159994 159994 159993 159993 159992 159992 159991 159991 159990 159990 159989 159989 159988 159988 159987 159987 159986 159986 159985 159985 159984 159984 159983 159983 159982 159982 159981 159981...
output:
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
result:
ok OK. Jury's and participant's answers coincide. We don't know if they are both correct or both wrong.
Test #24:
score: 0
Accepted
time: 146ms
memory: 249800kb
input:
160001 300000 100814 81998 81998 47964 47964 15162 15162 99833 99833 91815 91815 91064 91064 44409 44409 7755 7755 43827 43827 97797 97797 96617 96617 128251 128251 116798 116798 61949 61949 14165 14165 35036 35036 12130 12130 55984 55984 119544 119544 15032 15032 153671 153671 9090 9090 56365 56365...
output:
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
result:
ok OK. Jury's and participant's answers coincide. We don't know if they are both correct or both wrong.
Test #25:
score: -100
Wrong Answer
time: 81ms
memory: 238424kb
input:
205014 299995 1 2 3 2 4 2 1 5 6 5 7 6 1 8 10 8 10 9 1 11 12 11 13 11 13 12 1 14 15 14 16 14 17 14 1 18 19 18 20 19 21 18 1 22 24 22 24 23 25 22 1 26 27 26 28 26 28 27 29 26 1 30 31 30 32 30 33 31 1 34 35 34 36 35 37 35 1 38 40 38 40 39 41 39 1 42 43 42 44 42 44 43 45 43 1 46 48 46 49 46 49 47 1 50 5...
output:
139963 139961
result:
wrong answer Line "139963 139961" doesn't correspond to pattern "[0-1]{1,5000000}"