QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#284455 | #7942. $K$ Subsequences | ucup-team2303# | AC ✓ | 49ms | 32108kb | C++14 | 2.1kb | 2023-12-16 13:34:38 | 2023-12-16 13:34:38 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const long long mod=1e9+7;
long long T,a,b,c,d[1000001],v[1000001],o,h[1000001],fa[1000001],q,w,e,an,cn,fac[1000001],inv[1000001],st[1000001],u[1000001],id[1000001];
char s[1000001];
struct p{long long q,w;}l[1000001];
long long pow_(long long qq,long long ww){long long ee=1;while(ww){if(ww&1) ee*=qq,ee%=mod;qq*=qq,qq%=mod,ww>>=1;}return ee%mod;}
inline int read(){int x=0,f=1;char c=getchar();while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}while(c>='0'&&c<='9'){x=(x<<3)+(x<<1)+c-'0';c=getchar();}return x*f;}
void add(long long qq,long long ww){l[++o].q=ww,l[o].w=h[qq],h[qq]=o;}
long long gcd(long long qq,long long ww){return !ww?qq:gcd(ww,qq%ww);}
long long find(long long qq){return qq==fa[qq]?qq:fa[qq]=find(fa[qq]);}
void merge(long long qq,long long ww){long long f1=find(qq),f2=find(ww);if(f1==f2) return;fa[f1]=f2;}
long long C(long long qq,long long ww){return fac[qq]*inv[ww]%mod*inv[qq-ww]%mod;}
queue<long long> qu,qu1;
bool ch(long long qq)
{
while(!qu.empty()) qu.pop();
while(!qu1.empty()) qu1.pop();
long long ff=0;
for(int i=1;i<=b;i++)
{
for(int j=1;j<=qq;j++) qu.push(i);
}
for(int i=a;i>=1;i--)
{
if(d[i]==1)
{
if(qu.size()==0) return 0;
id[i]=qu.front();qu.pop();
qu1.push(id[i]);
}
else
{
if(qu1.size()==0)
{
id[i]=1;
}
else
{
id[i]=qu1.front();qu.push(id[i]);qu1.pop();
}
}
}
return 1;
}
int main()
{
// freopen("1.in","r",stdin);
srand((unsigned)(time(0)^(*new int)));
fac[0]=1;for(int i=1;i<=1000000;i++) fac[i]=fac[i-1]*i%mod;
inv[1000000]=pow_(fac[1000000],mod-2);for(int i=999999;i>=0;i--) inv[i]=inv[i+1]*(i+1)%mod;
T=1;
scanf("%lld",&T);
for(int ii=1;ii<=T;ii++)
{
scanf("%lld%lld",&a,&b);
for(int i=1;i<=a;i++)
{
scanf("%lld",&d[i]);
}
long long ll=1,rr=a/b+1;an=rr;
while(ll<=rr)
{
long long mid=((ll+rr)>>1);
if(ch(mid)) rr=mid-1,an=mid;
else ll=mid+1;
}
ch(an);
// printf("%lld\n",an);
for(int i=1;i<=a;i++) printf("%lld ",id[i]);
printf("\n");
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 4ms
memory: 26620kb
input:
5 3 2 1 -1 1 4 2 -1 1 1 -1 7 3 1 1 1 1 1 1 1 10 3 1 1 1 1 -1 -1 1 1 1 1 12 4 1 1 1 1 -1 -1 -1 -1 1 1 1 1
output:
2 1 1 1 2 1 1 3 2 2 2 1 1 1 1 1 3 3 1 1 2 2 1 1 4 3 2 1 4 3 2 1 4 3 2 1
result:
ok Correct (5 test cases)
Test #2:
score: 0
Accepted
time: 23ms
memory: 24572kb
input:
18434 10 1 -1 1 1 -1 -1 1 -1 -1 1 1 10 2 -1 -1 -1 1 1 -1 1 1 1 1 10 2 1 -1 -1 -1 -1 1 1 -1 1 1 10 7 1 1 -1 1 -1 1 1 -1 -1 1 9 1 -1 1 -1 1 1 -1 1 -1 1 8 1 -1 -1 -1 -1 1 1 -1 -1 10 3 -1 -1 -1 1 1 1 1 -1 -1 -1 9 1 1 -1 -1 1 -1 -1 -1 -1 -1 10 10 -1 1 1 1 1 1 1 1 1 1 10 4 -1 1 -1 1 -1 1 1 -1 1 1 9 3 1 1 ...
output:
1 1 1 1 1 1 1 1 1 1 2 1 1 2 2 1 2 1 1 1 1 1 2 2 1 2 2 1 1 1 6 5 3 4 2 3 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 9 8 7 6 5 4 3 2 1 4 2 3 1 2 4 3 1 2 1 1 3 1 2 2 1 1 1 1 2 1 2 4 3 2 1 1 2 1 7 6 5 4 3 2 1 1 4 1 3 3 2 1 2 1 1 1 1 1 1 1 1 1 1 1 1 3...
result:
ok Correct (18434 test cases)
Test #3:
score: 0
Accepted
time: 32ms
memory: 30844kb
input:
1 199996 3 1 -1 1 1 1 1 -1 -1 -1 1 1 -1 1 -1 1 1 -1 -1 1 1 1 1 -1 1 -1 -1 -1 1 -1 1 1 1 1 1 1 1 -1 -1 -1 1 -1 -1 1 1 -1 -1 -1 1 -1 1 1 -1 1 -1 -1 1 1 1 1 -1 1 1 1 1 1 1 1 1 -1 -1 -1 -1 1 1 -1 1 1 -1 1 -1 -1 -1 -1 -1 1 1 -1 -1 1 1 -1 1 -1 1 1 -1 1 1 1 -1 1 -1 1 1 1 -1 -1 -1 1 1 -1 -1 1 -1 -1 -1 -1 -1...
output:
2 1 2 2 2 2 1 1 1 2 2 1 2 1 2 2 1 1 2 2 2 2 1 2 1 1 1 2 1 2 2 2 2 2 2 2 1 1 1 2 1 1 2 2 1 1 1 2 1 2 2 1 2 1 3 2 2 2 2 3 2 2 2 2 2 2 2 2 3 3 3 3 2 2 3 2 2 3 2 3 3 3 3 3 2 2 3 3 2 2 3 2 3 2 2 3 2 2 2 3 2 3 1 1 1 3 3 3 1 1 3 3 1 3 3 3 3 3 3 1 1 1 3 1 1 1 1 1 1 3 1 3 1 1 1 3 3 3 3 1 3 1 3 1 1 3 3 1 3 1 ...
result:
ok Correct (1 test case)
Test #4:
score: 0
Accepted
time: 41ms
memory: 28728kb
input:
1 199998 152 -1 1 -1 -1 1 -1 -1 -1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 1 -1 -1 1 -1 1 1 -1 -1 1 1 1 -1 -1 -1 1 -1 1 -1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 1 1 -1 -1 1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 -1 1 -1 1 1 1 1 -1 1 1 1 -1 -1 1 -1 -1 1 1 -1 -1 -1 -1 1 -1 -1 1 -1 1 1 -1 1 1 -1 -1 1 -1 -1 1 -1 1 -1 1 1 -1...
output:
128 70 128 127 70 127 127 127 126 126 126 70 126 125 69 125 125 125 69 124 124 69 124 69 68 124 123 68 68 68 123 123 123 67 122 67 122 67 67 122 122 121 121 121 121 120 120 66 120 66 66 120 119 66 65 119 65 119 65 119 65 118 64 118 64 118 64 118 117 64 117 63 63 63 63 117 62 62 62 117 116 62 116 116...
result:
ok Correct (1 test case)
Test #5:
score: 0
Accepted
time: 41ms
memory: 30780kb
input:
1 199996 136 -1 1 1 1 1 1 -1 1 -1 -1 1 -1 1 1 -1 -1 1 1 1 1 1 -1 1 -1 -1 1 -1 1 1 -1 -1 1 -1 -1 1 -1 1 1 1 1 1 1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 1 -1 1 1 1 -1 1 1 1 1 1 -1 -1 1 -1 1 -1 -1 1 1 1 1 -1 1 -1 -1 -1 -1 1 1 -1 -1 -1 -1 1 -1 1 1 1 1 1 -1 -1 1 1 1 1 1 1 1 1 1 1 1 -1 -1 -1 1 1 1 1 1...
output:
105 9 9 9 8 8 104 8 104 104 7 103 7 7 103 103 6 6 6 5 5 102 5 102 102 4 101 4 4 101 101 3 100 100 3 100 3 2 2 2 1 1 99 99 99 98 1 98 98 97 97 97 96 96 96 136 136 136 95 135 135 135 95 134 134 134 133 133 95 94 133 94 132 94 93 132 132 131 131 93 131 93 92 92 92 130 130 91 91 91 90 130 90 129 129 129...
result:
ok Correct (1 test case)
Test #6:
score: 0
Accepted
time: 32ms
memory: 29548kb
input:
1 199998 86240 1 1 -1 1 1 1 1 1 1 -1 1 1 -1 1 -1 -1 -1 1 1 1 1 1 1 1 -1 1 1 1 1 1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 -1 1 1 -1 -1 -1 1 1 -1 -1 1 1 -1 1 -1 1 -1 1 -1 1 1 1 1 1 -1 1 -1 1 -1 1 -1 -1 1 1 1 -1 -1 -1 -1 -1 -1 1 1 1 1 -1 -1 -1 1 1 -1 -1 1 -1 1 1 1 -1 -1 -1 1 -1 -1 -1 -1 1 1 -1...
output:
13720 13719 13686 13718 13717 13716 13715 13714 13713 13685 13712 13711 13684 13710 13683 13682 13681 13709 13708 13707 13706 13705 13704 13703 13680 13702 13701 13700 13699 13698 13679 13697 13678 13677 13676 13675 13674 13673 13672 13671 13696 13670 13669 13695 13668 13667 13666 13665 13694 13693 ...
result:
ok Correct (1 test case)
Test #7:
score: 0
Accepted
time: 27ms
memory: 32108kb
input:
1 199998 196586 1 -1 -1 -1 1 -1 1 -1 1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 -1 -1 -1 1 -1 1 1 1 -1 -1 -1 1 -1 -1 -1 1 1 -1 1 -1 1 -1 1 1 1 -1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 1 1 1 1 1 -1 1 1 -1 1 1 1 1 -1 -1 -1 1 1 -1 -1 1 1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 1 -1 1 -1 -1 1 -1 1 -1 1 1 -1 -1 -1 -1...
output:
99941 99926 99925 99924 99940 99923 99939 99922 99938 99921 99920 99919 99937 99918 99917 99916 99936 99915 99914 99913 99912 99911 99935 99910 99934 99933 99932 99909 99908 99907 99931 99906 99905 99904 99930 99929 99903 99928 99902 99927 99901 99926 99925 99924 99900 99899 99898 99897 99923 99896 ...
result:
ok Correct (1 test case)
Test #8:
score: 0
Accepted
time: 30ms
memory: 27176kb
input:
2 53064 32664 1 1 1 -1 1 1 1 -1 1 1 1 -1 -1 1 -1 -1 1 1 1 -1 -1 1 -1 1 1 1 -1 -1 -1 1 -1 -1 -1 -1 -1 1 -1 1 -1 -1 1 -1 -1 1 1 -1 -1 -1 -1 1 1 1 -1 1 -1 -1 -1 -1 1 1 1 1 -1 1 1 -1 1 -1 1 -1 -1 1 -1 1 -1 -1 1 -1 1 1 -1 1 1 -1 -1 -1 1 1 1 1 1 -1 1 1 -1 1 1 -1 -1 -1 -1 1 1 -1 -1 -1 1 -1 1 1 -1 -1 1 1 1 ...
output:
26566 26565 26564 26480 26563 26562 26561 26479 26560 26559 26558 26478 26477 26557 26476 26475 26556 26555 26554 26474 26473 26553 26472 26552 26551 26550 26471 26470 26469 26549 26468 26467 26466 26465 26464 26548 26463 26547 26462 26461 26546 26460 26459 26545 26544 26458 26457 26456 26455 26543 ...
result:
ok Correct (2 test cases)
Test #9:
score: 0
Accepted
time: 49ms
memory: 28848kb
input:
2 86135 2 1 1 -1 -1 -1 1 1 -1 1 -1 -1 1 -1 1 -1 -1 -1 1 -1 1 1 1 1 -1 -1 1 -1 -1 1 1 1 -1 -1 1 1 -1 -1 -1 1 1 1 1 1 1 1 1 -1 -1 1 1 1 1 1 -1 1 -1 1 1 -1 1 -1 -1 1 -1 -1 -1 -1 1 -1 -1 1 1 1 -1 1 -1 1 1 -1 1 1 1 -1 1 -1 1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 -1 1 -1 1 1 1 1 1 1 1 -1 1 -1 1 -1 1 -1 1...
output:
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 1 1 2 2 2 2 2 1 2 1 2 2 1 2 1 1 2 1 1 1 1 2 1 1 2 2 2 1 2 1 2 2 1 2 2 2 1 2 1 2 1 2 1 1 1 1 1 1 1 1 1 1 2 2 1 2 1 2 2 2 2 2 2 2 1 2 1 2 1 2 1 2 2 1 1 1 2 2 2 1 2 1 2 1 1 1 1 1 1 1 2 1 2 1 2 2 1 1 2 2 1 2 2 1 ...
result:
ok Correct (2 test cases)
Test #10:
score: 0
Accepted
time: 36ms
memory: 29148kb
input:
2 114819 248 -1 -1 -1 -1 -1 1 -1 1 -1 -1 1 -1 1 1 -1 1 -1 -1 1 -1 -1 1 -1 1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 1 -1 -1 1 -1 1 1 1 1 -1 -1 -1 -1 1 1 1 1 1 -1 -1 1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 1 1 -1 -1 -1 1 1 -1 -1 -1 1 -1 1 -1 -1 -1 1 1 -1 -1 -1 -1 1 1 1 -1 -1 -1 -1 1 -1 -1 -1 1 1 1 -1 -1 -1 -1 -1 1 -...
output:
81 81 80 80 79 95 79 94 78 78 94 77 93 93 77 92 76 76 92 75 75 91 74 91 74 90 73 73 72 72 71 71 70 70 90 69 89 69 68 89 68 88 88 87 87 67 67 66 66 86 86 85 85 84 65 65 84 64 64 63 83 63 62 62 83 61 61 82 82 60 60 59 81 81 59 58 58 80 57 80 57 56 56 79 79 55 55 54 54 78 78 77 53 53 52 52 77 51 51 50 ...
result:
ok Correct (2 test cases)
Test #11:
score: 0
Accepted
time: 35ms
memory: 29216kb
input:
2 51745 1 -1 1 1 -1 1 -1 -1 1 -1 1 -1 1 1 1 -1 -1 1 -1 1 1 1 1 1 -1 1 -1 -1 1 -1 -1 1 -1 1 1 -1 1 -1 1 1 -1 1 1 -1 1 1 1 -1 -1 1 -1 1 -1 -1 -1 1 -1 -1 1 1 -1 -1 1 1 -1 -1 -1 1 1 -1 1 -1 -1 1 1 1 -1 -1 1 -1 -1 1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 1 -1 1 -1 -1 -1 -1 1 1 1 1 1 1 -1 -1 -1 -1 1 1 -1 1 1 -1 1 1 ...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok Correct (2 test cases)
Test #12:
score: 0
Accepted
time: 46ms
memory: 30860kb
input:
2 190655 1 1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 1 1 1 -1 -1 1 1 -1 -1 -1 1 -1 -1 -1 1 1 -1 -1 1 -1 -1 1 1 1 1 1 -1 -1 1 -1 1 1 -1 1 1 -1 -1 -1 1 -1 -1 1 1 -1 -1 -1 1 1 1 -1 1 -1 -1 -1 1 1 1 -1 -1 -1 -1 -1 1 1 -1 1 -1 1 -1 1 -1 -1 -1 -1 1 1 -1 -1 -1 1 -1 -1 1 1 1 1 1 1 -1 -1 ...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok Correct (2 test cases)
Test #13:
score: 0
Accepted
time: 46ms
memory: 26640kb
input:
3 509 3 -1 -1 1 1 -1 -1 1 1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 1 1 -1 -1 1 1 1 -1 1 -1 1 -1 -1 1 -1 1 -1 1 -1 -1 -1 1 -1 -1 -1 1 1 1 -1 -1 -1 -1 -1 1 -1 1 -1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 1 -1 1 -1 -1 1 -1 1 1 -1 -1 -1 1 -1 1 1 -1 -1 1 1 -1 -1 1 -1 -1 1 1 1 -1 1 -1 1 -1 -1 -1 1 1 1 -1 1 1 1 1 -1 1 -1 1 -...
output:
1 1 1 1 3 3 3 3 1 1 3 3 1 1 1 1 3 2 2 3 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 3 3 1 1 3 3 3 3 2 3 3 2 1 1 1 1 2 2 2 2 1 1 2 1 2 1 1 1 1 3 3 1 3 1 3 2 1 2 3 3 2 2 1 3 1 3 2 1 1 2 2 3 3 2 3 3 1 1 1 2 1 2 3 2 2 1 3 3 3 1 2 2 2 2 1 1 1 1 3 1 1 3 1 3 3 3 2 3 2 2 2 3 3 2 1 1 1 2 1 2 3 3 3 3 2 2 2 1 1 1 2 2 1 1 1 ...
result:
ok Correct (3 test cases)
Test #14:
score: 0
Accepted
time: 37ms
memory: 26812kb
input:
4 25729 81 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 1 -1 -1 -1 1 -1 -1 1 -1 1 1 1 -1 -1 1 1 -1 1 -1 -1 1 -1 -1 -1 1 -1 1 -1 -1 -1 -1 -1 -1 1 1 -1 -1 1 -1 1 1 1 1 1 1 -1 1 1 1 -1 -1 -1 1 1 1 1 1 1 1 -1 -1 -1 -1 1 -1 -1 -1 -1 1 -1 1 -1 1 1 -1 1 -1 1 1 -1 -1 1 1 1 1 1 1 -1 -1 1 1 -1 1 1 -1 -1 1 -1 1 ...
output:
26 25 25 25 10 24 24 24 23 23 23 22 22 9 22 9 21 21 21 9 20 20 8 20 8 8 7 19 19 7 7 19 6 18 18 6 18 17 17 6 17 5 16 16 16 15 15 15 5 5 14 14 4 14 4 4 3 3 3 2 13 2 2 1 13 13 12 1 1 81 81 81 80 80 12 12 11 11 80 11 10 10 10 79 9 79 9 79 78 9 78 8 78 77 8 8 77 77 76 76 76 75 7 7 75 75 7 74 74 6 6 74 6 ...
result:
ok Correct (4 test cases)
Test #15:
score: 0
Accepted
time: 34ms
memory: 28884kb
input:
5 7824 2 -1 -1 -1 -1 1 1 1 1 -1 1 1 1 -1 1 -1 -1 1 1 -1 -1 -1 1 -1 1 -1 1 -1 1 1 -1 1 1 1 1 -1 1 1 -1 1 1 1 -1 1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 1 1 -1 -1 1 1 1 1 -1 1 -1 -1 1 -1 1 -1 1 -1 1 -1 -1 1 1 -1 1 -1 1 -1 1 1 1 1 -1 1 -1 -1 -1 -1 -1 1 1 -1 1 -1 1 -1 1 1 1 -1 -1...
output:
2 2 2 2 1 1 1 1 2 1 1 2 2 2 2 2 2 2 1 1 1 2 1 2 1 2 1 2 2 1 2 2 2 2 1 2 2 1 2 2 2 1 2 1 1 1 2 1 1 1 2 1 1 2 1 1 1 2 1 1 1 1 1 2 2 2 2 2 2 2 1 1 1 2 1 2 2 1 2 1 2 1 2 1 2 2 1 1 2 1 2 1 2 1 1 1 1 2 1 2 2 2 2 2 1 1 2 1 2 1 2 1 1 1 2 2 1 1 1 1 1 2 1 2 1 1 1 1 1 1 2 2 2 1 2 1 1 1 2 2 2 2 2 2 1 1 2 2 2 2 ...
result:
ok Correct (5 test cases)
Test #16:
score: 0
Accepted
time: 32ms
memory: 28980kb
input:
6 7149 4795 -1 -1 1 -1 -1 1 1 -1 1 1 1 1 -1 1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 1 -1 -1 1 -1 -1 -1 -1 1 1 1 1 -1 1 -1 1 1 1 -1 -1 1 -1 1 1 1 -1 1 1 1 1 -1 1 -1 1 -1 1 -1 1 1 1 1 1 1 1 1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 -1 1 1 -1 -1 -1 -1 1 1 1 -1 1 1 -1 1 -1 1 -1 1 1 -1 1 -1 -1 -1 1 1 1 1 1 1 -1 -1 -1...
output:
3502 3501 3566 3500 3499 3565 3564 3498 3563 3562 3561 3560 3497 3559 3496 3495 3494 3493 3492 3491 3490 3558 3489 3488 3557 3487 3486 3556 3485 3484 3483 3482 3555 3554 3553 3552 3481 3551 3480 3550 3549 3548 3479 3478 3547 3477 3546 3545 3544 3476 3543 3542 3541 3540 3475 3539 3474 3538 3473 3537 ...
result:
ok Correct (6 test cases)
Test #17:
score: 0
Accepted
time: 48ms
memory: 28600kb
input:
7 16819 1 1 1 1 1 1 1 -1 -1 -1 1 1 1 -1 1 1 1 -1 1 1 -1 -1 -1 1 1 1 1 -1 1 1 -1 1 -1 1 1 -1 -1 1 1 -1 1 -1 1 -1 1 1 -1 -1 1 -1 -1 -1 1 -1 1 -1 -1 -1 -1 -1 -1 -1 1 -1 1 1 -1 -1 1 -1 1 -1 1 1 -1 -1 -1 1 -1 -1 -1 -1 1 -1 1 -1 1 -1 -1 -1 1 1 1 1 1 1 -1 1 -1 1 -1 1 1 1 1 -1 -1 1 1 1 -1 1 -1 -1 1 -1 -1 1 ...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok Correct (7 test cases)
Test #18:
score: 0
Accepted
time: 29ms
memory: 26504kb
input:
8 29021 106 -1 -1 -1 -1 1 -1 1 -1 1 -1 1 1 1 -1 -1 1 1 1 1 1 -1 -1 1 1 -1 -1 -1 1 1 -1 -1 -1 -1 -1 -1 1 1 -1 1 1 1 -1 -1 -1 1 1 1 1 1 1 1 1 -1 1 -1 1 -1 -1 1 -1 1 -1 1 -1 1 1 -1 1 1 -1 1 -1 -1 -1 1 1 1 1 -1 -1 -1 -1 1 -1 1 -1 -1 1 1 -1 -1 -1 1 -1 1 1 -1 1 1 1 -1 1 -1 1 1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 ...
output:
94 93 93 92 97 92 96 91 96 91 95 95 94 90 90 94 93 93 92 92 89 89 91 91 88 88 87 90 90 87 86 86 85 85 84 89 89 84 88 88 87 83 83 82 87 86 86 85 85 84 84 83 82 83 81 82 81 80 82 80 81 79 81 79 80 80 78 79 79 78 78 77 77 76 78 77 77 76 1 76 75 75 76 74 75 74 73 75 74 73 72 72 74 71 73 73 71 72 72 71 7...
result:
ok Correct (8 test cases)
Test #19:
score: 0
Accepted
time: 45ms
memory: 26804kb
input:
9 37136 1 -1 1 -1 -1 -1 -1 1 -1 1 -1 -1 1 1 1 1 1 1 1 -1 1 1 -1 1 1 1 -1 -1 1 1 1 1 -1 1 -1 1 -1 -1 1 -1 1 -1 -1 -1 -1 -1 1 -1 1 -1 1 1 -1 -1 1 -1 -1 1 1 1 1 1 -1 -1 -1 -1 -1 -1 -1 1 1 1 -1 -1 1 1 -1 1 1 1 1 1 1 -1 -1 -1 -1 -1 1 1 1 -1 1 -1 -1 -1 1 -1 -1 1 -1 1 1 1 1 1 -1 -1 1 -1 -1 1 1 1 1 -1 1 -1 ...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok Correct (9 test cases)
Test #20:
score: 0
Accepted
time: 38ms
memory: 24488kb
input:
10 5543 1596 1 1 1 -1 1 1 1 -1 -1 -1 1 1 -1 -1 -1 1 -1 1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 1 1 -1 1 -1 -1 -1 1 1 -1 1 -1 -1 -1 1 -1 1 1 -1 -1 1 1 1 1 1 -1 -1 1 1 -1 1 1 -1 1 -1 1 1 -1 -1 -1 1 -1 1 -1 -1 1 -1 -1 -1 1 -1 -1 1 -1 -1 1 -1 1 -1 -1 1 -1 -1 -1 -1 -1 -1 1 1 1 1 -1 -1 -1 -1 1 1 1 1 -1 -1 -1 -1 1 ...
output:
1238 1237 1236 1101 1235 1234 1233 1100 1099 1098 1232 1231 1097 1096 1095 1230 1094 1229 1093 1092 1228 1091 1090 1089 1088 1087 1086 1085 1227 1226 1084 1225 1083 1082 1081 1224 1223 1080 1222 1079 1078 1077 1221 1076 1220 1219 1075 1074 1218 1217 1216 1215 1214 1073 1072 1213 1212 1071 1211 1210 ...
result:
ok Correct (10 test cases)
Test #21:
score: 0
Accepted
time: 40ms
memory: 26380kb
input:
100 2336 29 -1 -1 -1 1 -1 1 1 -1 -1 -1 1 -1 -1 1 1 1 1 1 1 -1 -1 1 1 -1 1 -1 -1 -1 1 -1 -1 1 1 1 1 -1 1 1 -1 1 -1 1 1 1 -1 -1 -1 -1 -1 1 1 -1 1 1 -1 -1 1 1 -1 -1 1 1 -1 -1 1 -1 -1 -1 1 -1 -1 -1 1 1 1 1 1 -1 -1 1 -1 -1 -1 -1 -1 -1 1 -1 1 1 1 1 1 -1 1 1 1 -1 1 1 1 -1 1 -1 1 -1 1 1 1 1 1 -1 1 -1 -1 -1 ...
output:
5 5 5 20 4 19 19 4 4 3 19 3 3 18 18 18 17 17 17 2 2 16 16 2 16 1 1 1 15 29 29 15 15 14 14 29 14 13 28 13 28 13 12 12 28 27 27 27 26 12 11 26 11 11 26 25 10 10 25 25 10 9 24 24 9 24 23 23 9 23 22 22 8 8 8 7 7 22 21 7 21 21 20 20 20 19 6 19 6 6 5 5 5 19 4 4 4 18 3 3 3 18 2 18 2 17 2 1 1 1 29 17 29 17 ...
result:
ok Correct (100 test cases)
Test #22:
score: 0
Accepted
time: 34ms
memory: 24412kb
input:
101 92 1 1 1 -1 1 1 -1 -1 -1 -1 -1 1 -1 -1 1 -1 1 1 -1 1 -1 1 1 1 1 -1 -1 -1 1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 1 1 -1 1 -1 -1 1 -1 -1 1 -1 -1 -1 -1 -1 1 -1 1 -1 -1 -1 -1 1 1 -1 1 1 -1 1 1 1 1 -1 -1 1 1 1 1 1 1 1 1 1 1 -1 -1 2647 2314 -1 1 -1 -1 1 1 1 -1 1 1 1 1 -1 1 -1 -1 1 -1 -1...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1249 1381 1248 1247 1380 1379 1378 1246 1377 1376 1375 1374 1245 1373 1244 1243 1372 1242 1241 1240 1371 1239 1238 ...
result:
ok Correct (101 test cases)
Test #23:
score: 0
Accepted
time: 34ms
memory: 24452kb
input:
102 8381 7064 -1 -1 1 1 -1 -1 1 -1 1 1 1 1 1 -1 -1 1 -1 1 -1 1 1 1 -1 -1 -1 1 -1 1 1 1 1 -1 -1 -1 -1 1 1 1 -1 -1 1 1 -1 1 -1 1 -1 -1 1 -1 -1 1 -1 1 1 -1 -1 1 1 1 -1 -1 -1 1 1 1 1 1 1 -1 -1 1 -1 1 -1 -1 -1 -1 1 1 -1 1 1 -1 -1 1 -1 -1 1 -1 -1 -1 1 -1 -1 1 -1 1 1 -1 -1 1 1 1 1 -1 -1 1 1 1 -1 1 -1 -1 -1...
output:
4113 4112 4229 4228 4111 4110 4227 4109 4226 4225 4224 4223 4222 4108 4107 4221 4106 4220 4105 4219 4218 4217 4104 4103 4102 4216 4101 4215 4214 4213 4212 4100 4099 4098 4097 4211 4210 4209 4096 4095 4208 4207 4094 4206 4093 4205 4092 4091 4204 4090 4089 4203 4088 4202 4201 4087 4086 4200 4199 4198 ...
result:
ok Correct (102 test cases)
Test #24:
score: 0
Accepted
time: 32ms
memory: 28740kb
input:
103 1976 404 1 -1 -1 1 -1 -1 -1 -1 1 1 1 -1 1 1 -1 -1 1 -1 1 -1 1 -1 -1 1 1 1 1 -1 -1 1 1 1 -1 1 -1 -1 1 -1 1 -1 1 -1 1 1 1 1 1 1 -1 -1 1 -1 -1 1 1 1 1 1 1 -1 -1 1 1 1 1 -1 -1 -1 1 -1 1 -1 1 1 1 1 -1 1 -1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 1 -1 -1 -1 1 -1 1 1 -1 1 1 -1 1 -1 1 -1 -1 -1 -1 -1 -1 1 1 1 1 -1 -...
output:
162 136 135 161 134 133 132 131 160 159 158 130 157 156 129 128 155 127 154 126 153 125 124 152 151 150 149 123 122 148 147 146 121 145 120 119 144 118 143 117 142 116 141 140 139 138 137 136 115 114 135 113 112 134 133 132 131 130 129 111 110 128 127 126 125 109 108 107 124 106 123 105 122 121 120 ...
result:
ok Correct (103 test cases)
Test #25:
score: 0
Accepted
time: 31ms
memory: 24372kb
input:
104 3135 3 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 -1 -1 1 1 1 -1 -1 -1 -1 1 1 -1 1 -1 -1 -1 -1 -1 -1 1 1 -1 -1 -1 1 1 -1 -1 1 1 -1 -1 -1 1 -1 1 1 -1 -1 -1 -1 1 -1 -1 -1 1 -1 1 -1 1 -1 1 -1 -1 1 1 -1 -1 1 -1 -1 -1 -1 1 -1 1 1 1 1 1 1 -1 1 -1 -1 1 1 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 1 2 2 1 1 2 1 1 1 3 1 3 1 3 3 3 3 1 3 3 2 2 2 2 1 2 2 2 1 2 1 1 1 1 1 3 1 1 1 3 3 3 3 3 1 1 3 3 1 1 1 2 2 2 2 2 2 1 1 2 1 2 1 1 1 1 1 1 1 1 1 3 3 3 3 1 1 1 1 1 3 3 1 3 2 2 3 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 3 3 3 3 1 1 1 3 3 1 3 3 2 2 2 2 2 2 1 2 1 2 1 1 1 1 1 1 ...
result:
ok Correct (1001 test cases)
Test #29:
score: 0
Accepted
time: 32ms
memory: 26376kb
input:
1002 182 6 1 1 1 1 -1 -1 1 -1 -1 1 1 -1 1 1 -1 1 1 1 1 1 -1 -1 -1 -1 1 -1 1 1 1 -1 -1 1 1 1 1 -1 1 1 -1 -1 -1 -1 -1 1 -1 -1 1 1 -1 -1 -1 1 -1 1 -1 -1 -1 1 1 1 -1 1 1 1 1 -1 -1 -1 -1 -1 1 -1 1 -1 1 1 -1 -1 1 1 1 1 -1 1 1 -1 -1 -1 -1 1 1 1 1 1 1 1 -1 1 -1 -1 -1 1 -1 -1 -1 -1 1 1 -1 -1 -1 -1 1 -1 1 1 1...
output:
2 2 2 1 5 4 1 4 4 1 6 3 6 6 3 5 5 5 4 4 3 2 2 2 4 1 3 3 3 1 1 2 2 2 1 6 1 1 6 6 5 5 5 6 4 4 6 6 4 3 3 5 3 5 2 2 2 5 4 4 1 4 3 3 3 1 1 6 6 6 2 5 2 5 2 1 5 4 1 1 6 6 4 6 5 4 3 3 3 5 5 4 4 4 3 3 2 3 2 2 1 2 1 1 6 6 2 2 6 5 5 5 1 4 1 1 6 6 4 6 5 5 4 5 3 3 3 2 4 2 2 1 4 1 1 4 6 6 6 3 5 5 3 5 3 2 2 2 4 4 ...
result:
ok Correct (1002 test cases)
Test #30:
score: 0
Accepted
time: 26ms
memory: 26380kb
input:
1003 95 16 1 -1 -1 1 1 1 -1 -1 -1 -1 -1 1 1 1 -1 -1 -1 -1 1 1 1 -1 1 -1 1 1 -1 -1 -1 -1 1 -1 1 -1 -1 -1 1 -1 -1 1 -1 1 -1 -1 1 -1 -1 1 -1 -1 -1 1 1 1 -1 1 1 1 -1 -1 -1 -1 1 1 -1 1 1 1 1 1 -1 -1 1 1 -1 -1 -1 1 -1 -1 -1 -1 -1 1 -1 -1 -1 1 1 1 1 -1 -1 1 1 526 3 1 -1 -1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1...
output:
11 9 8 10 9 8 1 1 7 6 5 7 6 5 4 3 2 1 4 3 2 16 1 15 16 15 1 1 1 14 14 13 13 1 12 11 12 10 9 11 8 10 7 6 9 5 4 8 3 2 1 7 6 5 16 4 3 2 15 14 13 12 1 16 11 15 14 13 12 11 10 9 10 9 1 1 8 8 1 1 1 7 6 7 5 4 3 6 5 4 3 2 1 2 1 1 1 1 3 3 1 1 1 1 1 1 1 1 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 3 2 3 3 3 2 2 2 2 2 2 2...
result:
ok Correct (1003 test cases)
Test #31:
score: 0
Accepted
time: 32ms
memory: 26380kb
input:
1004 322 257 -1 1 1 1 1 1 1 -1 -1 1 1 -1 -1 -1 1 -1 -1 1 -1 1 -1 -1 -1 1 1 1 1 1 1 -1 1 1 -1 1 -1 1 -1 1 1 -1 1 -1 1 1 1 -1 1 1 -1 -1 1 -1 1 1 -1 -1 -1 1 -1 1 -1 1 -1 1 1 1 -1 1 1 1 -1 -1 1 1 -1 -1 -1 1 1 1 1 1 1 1 -1 -1 1 1 1 1 1 1 1 1 -1 -1 -1 1 -1 1 -1 1 1 -1 -1 -1 1 -1 1 1 1 1 -1 -1 1 -1 -1 1 -1...
output:
139 162 161 160 159 158 157 138 137 156 155 136 135 134 154 133 132 153 131 152 130 129 128 151 150 149 148 147 146 127 145 144 126 143 125 142 124 141 140 123 139 122 138 137 136 121 135 134 120 119 133 118 132 131 117 116 115 130 114 129 113 128 112 127 126 125 111 124 123 122 110 109 121 120 108 ...
result:
ok Correct (1004 test cases)
Test #32:
score: 0
Accepted
time: 37ms
memory: 26664kb
input:
1005 508 4 1 -1 -1 -1 1 1 1 1 1 1 1 -1 1 1 1 -1 1 -1 1 -1 1 1 -1 1 -1 -1 1 -1 -1 1 -1 -1 1 1 -1 1 1 -1 1 -1 -1 -1 -1 1 -1 -1 1 1 1 1 -1 1 -1 1 -1 1 1 1 -1 -1 -1 -1 1 1 -1 1 -1 1 -1 1 -1 1 -1 1 1 1 -1 -1 1 -1 -1 -1 -1 1 1 -1 -1 -1 -1 1 -1 1 -1 1 1 -1 -1 1 -1 -1 1 1 -1 -1 1 -1 -1 -1 1 1 1 -1 -1 1 1 1 ...
output:
4 4 4 4 4 3 3 3 3 3 3 4 2 2 2 3 2 3 2 3 2 1 3 1 3 3 1 2 2 1 2 2 1 1 2 4 4 2 4 1 1 1 1 4 1 1 4 4 3 3 4 3 4 3 4 3 3 2 4 4 4 3 2 2 3 2 3 2 3 2 3 1 3 1 1 1 2 2 1 2 2 2 2 1 4 1 1 1 1 4 1 4 1 4 4 4 4 4 4 4 3 3 4 4 3 3 3 3 3 3 3 3 3 2 2 2 2 2 3 2 1 1 1 1 2 1 1 4 2 2 4 2 2 2 4 4 1 4 4 3 3 1 1 1 3 1 1 4 4 4 ...
result:
ok Correct (1005 test cases)
Test #33:
score: 0
Accepted
time: 34ms
memory: 24320kb
input:
9995 9 7 -1 1 -1 -1 -1 1 -1 -1 1 1 1 -1 7 1 -1 -1 -1 -1 1 -1 -1 25 1 1 1 1 1 1 1 1 -1 -1 -1 -1 1 -1 -1 1 1 1 -1 1 -1 1 1 -1 -1 -1 24 22 1 -1 1 -1 1 -1 1 1 1 -1 1 1 1 1 -1 1 1 -1 1 -1 -1 1 -1 -1 6 3 1 -1 1 1 -1 -1 6 4 -1 1 -1 -1 -1 1 14 9 -1 -1 1 -1 1 -1 1 1 1 1 1 1 1 -1 24 3 1 -1 -1 -1 1 1 -1 1 1 1 ...
output:
3 3 1 1 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 14 7 13 6 12 5 11 10 9 4 8 7 6 5 3 4 3 2 2 1 1 1 1 1 3 1 2 1 1 1 2 2 1 1 1 1 4 3 9 2 8 1 7 6 5 4 3 2 1 1 2 3 2 2 1 1 2 1 3 3 3 2 1 2 2 1 1 1 1 1 1 1 1 1 1 8 7 2 6 5 1 4 8 3 7 6 2 5 4 1 3 8 2 7 1 8 6 7 6 5 5 ...
result:
ok Correct (9995 test cases)
Test #34:
score: 0
Accepted
time: 19ms
memory: 26372kb
input:
9996 27 1 1 1 -1 -1 -1 -1 -1 -1 -1 1 1 1 -1 -1 -1 -1 1 -1 1 -1 -1 -1 1 1 -1 1 1 7 2 1 1 1 1 -1 -1 1 22 3 -1 -1 1 1 -1 -1 -1 1 1 1 -1 -1 -1 -1 -1 1 -1 1 1 -1 -1 1 37 4 -1 -1 -1 1 -1 1 -1 -1 -1 1 1 -1 1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 1 1 1 1 1 -1 1 1 1 7 1 -1 1 -1 -1 1 1 1 29 1 -1 -1 1 -1 1 -1 1...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 1 1 1 1 3 2 3 2 1 3 2 1 3 2 1 1 1 1 3 1 2 3 2 1 1 1 2 1 1 3 1 3 4 4 4 3 2 3 2 2 3 1 3 1 2 1 2 4 2 4 1 4 1 3 3 3 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 8 7 6 5 4 3 2 1 1 1 1 1 1 3 2 3 1...
result:
ok Correct (9996 test cases)
Test #35:
score: 0
Accepted
time: 39ms
memory: 24600kb
input:
9997 15 9 -1 1 1 -1 1 1 -1 1 -1 1 1 1 1 1 1 1 1 1 37 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1 1 3 1 3 3 2 2 2 1 1 1 1 1 1 3 3 3 3 2 3 3 2 2 2 2 2 1 1 1 1 1 1 3 1 3 3 2 1 2 3 2 3 1 1 3 2 2 1 3 3 2 1 1 3 1 2 3 3 3 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok Correct (9998 test cases)
Test #37:
score: 0
Accepted
time: 39ms
memory: 24612kb
input:
9999 65 2 -1 -1 1 1 -1 -1 -1 1 -1 -1 -1 1 1 -1 -1 -1 -1 1 -1 1 1 -1 -1 1 -1 1 1 1 -1 -1 1 1 1 1 -1 1 -1 1 -1 1 -1 -1 -1 1 1 -1 -1 -1 -1 1 1 1 1 -1 -1 1 -1 1 1 1 1 1 1 1 1 12 3 1 1 1 1 -1 -1 -1 -1 1 1 -1 -1 75 2 1 -1 1 -1 -1 -1 1 1 -1 1 -1 1 -1 -1 -1 1 1 1 -1 1 -1 1 1 -1 1 -1 -1 1 -1 -1 -1 1 1 -1 1 1...
output:
1 2 1 1 2 2 2 1 2 1 1 1 2 1 1 1 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 2 2 1 2 1 2 1 2 2 2 2 1 1 2 2 1 1 1 1 1 2 1 1 2 1 2 2 2 1 1 1 1 1 3 3 2 2 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 2 1 2 2 2 2 1 2 2 2 1 1 1 1 1 1 1 2 2 2 2 2 1 2 2 1 2 1 1 1 1 2 1 2 1 2 2 2 2 1 2 1 1 1 1 2 2 1 2 2 2 1 1 1 2 1 1 2 2 2 1 1 1 1 ...
result:
ok Correct (9999 test cases)
Test #38:
score: 0
Accepted
time: 30ms
memory: 26652kb
input:
10000 15 3 -1 1 -1 1 -1 -1 1 -1 1 -1 1 -1 -1 -1 1 3 3 -1 1 1 34 2 -1 -1 -1 -1 1 -1 1 -1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 1 -1 1 -1 -1 1 -1 1 1 -1 -1 -1 1 -1 1 1 3 2 1 1 -1 25 2 -1 -1 1 1 1 -1 1 -1 1 -1 -1 -1 1 1 1 -1 1 1 1 1 -1 1 -1 1 -1 11 1 1 -1 -1 -1 -1 -1 1 -1 -1 -1 1 29 2 -1 -1 -1 1 -1 1 -1 -1 -1 -1...
output:
3 3 2 2 1 1 1 3 3 2 2 1 1 1 1 1 2 1 1 1 1 2 2 1 1 1 1 1 2 2 1 1 1 1 1 2 2 1 1 2 1 2 2 1 2 1 1 2 1 1 2 1 2 1 1 2 1 1 1 2 1 2 1 2 2 2 2 1 1 1 1 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 1 1 1 1 2 2 1 1 2 2 1 1 1 1 2 1 2 1 2 2 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok Correct (10000 test cases)
Extra Test:
score: 0
Extra Test Passed