QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#292866 | #7604. Find the Vertex | ship2077 | AC ✓ | 31ms | 6284kb | C++14 | 527b | 2023-12-28 15:37:09 | 2023-12-28 15:37:09 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
constexpr int M=5e5+5;
int n,m,x,y,a[M];bool flag[M];
int read(){
int x=0;char ch=getchar();
while (!isdigit(ch)) ch=getchar();
while (isdigit(ch)) x=x*10+ch-48,ch=getchar();
return x;
}
int main(){
n=read();m=read();
for (int i=1;i<=n;i++) a[i]=read();
for (int i=1;i<=m;i++){
x=read();y=read();
if ((a[x]+1)%3==a[y]) flag[y]=1;
if ((a[y]+1)%3==a[x]) flag[x]=1;
}
for (int i=1;i<=n;i++)
if (!flag[i])
return printf("%d ",i),0;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3792kb
input:
5 6 1 0 1 1 2 5 4 1 2 3 2 3 4 4 2 1 5
output:
2
result:
ok 1 number(s): "2"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3856kb
input:
6 6 0 1 2 0 2 1 1 2 2 3 3 4 4 5 5 6 6 1
output:
1
result:
ok 1 number(s): "1"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3920kb
input:
10 9 1 2 0 0 0 0 2 2 1 0 1 4 8 5 4 9 10 8 3 8 9 8 7 9 6 8 2 9
output:
4
result:
ok 1 number(s): "4"
Test #4:
score: 0
Accepted
time: 1ms
memory: 5864kb
input:
10 12 2 1 2 0 2 0 1 0 1 1 7 5 5 2 7 1 9 6 3 2 1 2 10 6 4 3 6 2 7 10 8 1 6 7
output:
6
result:
ok 1 number(s): "6"
Test #5:
score: 0
Accepted
time: 0ms
memory: 3700kb
input:
10 20 2 1 0 2 2 2 1 0 1 1 5 3 4 1 7 4 2 4 6 2 5 2 1 7 4 5 9 1 1 5 6 1 6 4 8 2 10 8 3 1 2 7 9 5 8 7 8 9 9 2
output:
8
result:
ok 1 number(s): "8"
Test #6:
score: 0
Accepted
time: 0ms
memory: 3756kb
input:
10 30 1 1 2 0 1 2 1 2 1 1 7 5 7 2 9 6 8 7 8 9 7 1 4 1 3 1 9 10 9 7 6 1 9 4 9 1 1 5 4 7 2 10 8 2 3 5 9 3 10 6 5 4 2 9 4 2 10 4 10 5 1 10 1 8 6 3 2 5 5 6
output:
4
result:
ok 1 number(s): "4"
Test #7:
score: 0
Accepted
time: 0ms
memory: 3792kb
input:
100 99 1 1 1 1 0 2 2 0 0 1 1 2 1 2 0 1 0 0 0 0 0 2 1 1 2 0 2 1 1 1 0 0 0 0 0 2 0 0 1 0 2 0 2 2 0 1 2 1 0 1 2 0 2 1 0 1 0 0 2 2 2 2 2 0 1 0 0 0 1 0 2 0 1 2 0 2 0 1 1 1 1 2 0 0 2 2 2 0 1 0 0 0 1 0 2 0 2 2 1 0 57 62 63 3 39 15 70 71 72 86 87 30 60 30 17 76 15 14 22 28 89 38 61 28 93 66 21 86 6 30 40 76...
output:
49
result:
ok 1 number(s): "49"
Test #8:
score: 0
Accepted
time: 1ms
memory: 5848kb
input:
100 120 0 0 0 2 0 1 2 0 2 1 2 2 0 1 2 2 2 2 1 2 0 0 1 0 2 1 2 2 0 0 0 0 2 2 0 2 2 0 1 1 0 1 2 1 0 0 2 0 1 1 2 1 2 2 1 0 2 0 2 1 2 0 1 1 2 1 0 2 1 1 2 0 2 1 2 2 0 1 2 1 1 2 1 0 1 2 0 2 2 0 0 0 1 0 2 1 2 2 1 1 28 31 77 53 6 2 53 41 44 2 73 42 79 72 59 39 20 59 34 50 47 96 30 54 98 69 93 45 43 10 95 93...
output:
1
result:
ok 1 number(s): "1"
Test #9:
score: 0
Accepted
time: 0ms
memory: 3792kb
input:
100 200 1 2 0 1 2 1 0 1 1 1 1 1 0 1 0 0 1 1 1 1 1 0 2 0 1 0 2 0 1 2 1 0 1 0 0 2 1 0 1 2 2 1 2 2 1 2 0 0 2 1 2 1 1 0 2 1 2 1 2 2 0 2 1 1 2 1 0 0 1 2 0 0 0 0 0 1 2 2 1 1 0 0 1 0 0 0 1 2 1 0 2 0 1 2 2 2 1 1 1 2 26 71 21 29 9 100 45 18 92 88 17 2 93 26 7 5 98 8 83 84 66 11 94 25 74 18 100 15 6 30 5 24 2...
output:
81
result:
ok 1 number(s): "81"
Test #10:
score: 0
Accepted
time: 0ms
memory: 3752kb
input:
100 300 2 1 2 0 1 0 0 0 0 0 2 0 0 1 0 2 0 1 0 0 0 0 2 2 2 0 0 0 1 0 0 2 0 2 0 0 0 2 0 2 0 1 0 1 0 1 0 0 0 0 2 2 2 2 0 0 0 0 2 1 0 2 0 1 0 2 2 0 0 1 2 1 2 0 1 2 1 2 2 2 2 0 2 0 0 2 2 0 0 1 2 0 0 0 2 0 2 1 0 1 62 50 75 13 21 48 4 76 84 87 1 13 18 39 95 58 38 87 19 15 96 58 50 18 52 56 96 7 47 33 74 27...
output:
65
result:
ok 1 number(s): "65"
Test #11:
score: 0
Accepted
time: 1ms
memory: 3808kb
input:
10000 9999 1 1 2 1 2 0 0 2 2 1 2 1 1 0 1 1 0 2 1 2 1 1 0 2 1 0 1 2 1 2 2 0 2 0 0 2 0 0 1 1 0 2 0 2 2 2 0 2 1 2 0 1 2 2 1 0 0 1 1 2 0 1 0 0 0 0 0 2 2 1 1 1 1 0 0 2 2 0 0 2 1 0 1 2 1 2 2 0 2 0 2 2 1 0 2 1 2 1 0 1 0 1 1 1 1 2 0 1 2 1 0 1 1 0 2 1 0 0 1 1 0 0 0 1 2 0 2 2 0 0 0 0 0 2 0 2 0 2 0 1 0 2 2 1 1...
output:
8495
result:
ok 1 number(s): "8495"
Test #12:
score: 0
Accepted
time: 1ms
memory: 5784kb
input:
10000 12000 2 0 1 0 1 0 2 2 1 2 2 2 0 0 0 0 2 0 0 1 1 2 1 1 2 2 1 2 0 1 2 2 0 1 1 1 0 0 2 1 0 1 1 0 0 1 1 2 1 0 0 2 1 0 2 1 2 0 0 2 1 1 1 0 0 0 1 0 0 0 0 1 1 2 0 1 2 0 0 2 1 0 2 1 1 1 1 2 0 0 0 0 2 2 2 0 1 0 0 2 1 1 2 1 1 1 2 2 2 1 1 2 0 2 0 1 1 0 2 0 1 0 0 1 2 2 1 2 0 1 2 1 0 1 2 0 2 1 1 0 2 1 1 2 ...
output:
6173
result:
ok 1 number(s): "6173"
Test #13:
score: 0
Accepted
time: 1ms
memory: 3836kb
input:
10000 20000 1 0 0 1 0 1 2 1 1 1 2 1 2 2 1 1 0 1 0 0 0 0 0 0 1 0 2 2 1 1 1 0 1 1 0 1 2 2 1 1 2 0 1 0 0 2 1 2 2 1 1 0 2 1 0 1 1 1 1 0 0 0 1 0 0 1 1 1 2 2 1 1 2 0 1 0 1 2 0 2 0 2 2 1 1 1 2 0 2 1 1 0 0 1 1 0 2 1 1 0 0 2 1 1 2 2 2 0 1 1 2 0 0 1 1 1 0 0 1 0 1 1 2 1 0 0 1 0 2 1 2 0 1 2 1 0 1 1 1 1 2 0 1 0 ...
output:
8707
result:
ok 1 number(s): "8707"
Test #14:
score: 0
Accepted
time: 0ms
memory: 5972kb
input:
10000 30000 0 0 2 1 2 2 2 1 2 0 2 0 1 2 0 2 0 1 2 2 2 2 0 0 2 2 2 2 2 2 2 2 2 1 0 1 0 2 2 0 2 2 2 2 2 2 1 2 0 1 1 1 0 0 0 2 2 1 2 0 1 2 0 2 1 2 1 0 2 2 1 0 0 0 2 1 2 0 1 2 2 2 0 0 2 2 1 2 2 0 0 2 0 2 2 2 2 0 2 1 2 0 0 0 0 2 0 1 2 0 2 2 2 0 2 2 2 2 2 0 2 2 2 2 2 0 0 0 0 1 2 2 2 2 0 0 0 2 0 2 2 0 1 0 ...
output:
3998
result:
ok 1 number(s): "3998"
Test #15:
score: 0
Accepted
time: 13ms
memory: 5028kb
input:
250000 249999 1 2 2 0 1 0 1 0 1 1 2 1 1 0 2 0 0 1 1 2 0 2 1 0 1 2 0 2 0 0 0 2 0 2 2 1 2 2 0 0 2 2 2 1 1 1 0 0 2 0 0 0 0 1 2 1 2 0 2 2 2 1 1 2 0 0 0 2 0 2 0 1 2 2 1 1 1 0 1 0 0 2 1 0 1 0 0 0 1 2 0 0 2 1 2 0 0 0 2 1 1 1 1 1 1 0 1 2 0 2 0 2 1 1 1 2 0 0 0 2 0 1 2 0 0 2 2 0 2 1 2 2 0 0 2 0 2 2 0 2 2 0 2 ...
output:
179952
result:
ok 1 number(s): "179952"
Test #16:
score: 0
Accepted
time: 12ms
memory: 6028kb
input:
250000 250000 1 2 2 0 0 1 1 1 2 0 0 0 2 1 2 1 0 1 0 2 2 1 0 1 2 1 0 0 1 2 2 2 1 0 2 1 1 1 0 0 0 1 2 1 0 0 1 0 1 1 2 2 2 2 1 2 1 1 0 1 1 0 1 0 1 1 1 2 2 2 0 0 1 0 0 0 0 2 0 1 1 0 0 0 0 2 1 0 2 2 2 2 1 0 2 2 0 2 0 0 0 2 1 0 2 0 0 1 2 0 2 0 2 0 1 1 2 2 2 2 0 0 2 0 2 1 1 1 1 2 1 2 2 1 1 0 1 1 1 2 2 2 0 ...
output:
160937
result:
ok 1 number(s): "160937"
Test #17:
score: 0
Accepted
time: 13ms
memory: 5136kb
input:
250000 252500 0 1 2 2 2 2 2 2 1 2 0 2 1 2 0 1 1 0 2 2 0 1 2 1 2 1 0 0 1 0 1 0 0 0 1 1 1 1 1 1 1 1 1 0 1 1 2 0 2 2 2 0 2 1 2 1 2 0 2 2 1 2 2 2 0 1 1 0 0 0 2 1 2 1 0 0 1 1 0 1 1 1 2 2 2 0 0 2 1 0 1 1 1 0 0 1 2 2 0 0 1 1 1 2 2 2 0 1 0 2 2 2 1 0 0 2 0 1 0 0 0 0 0 2 0 2 0 2 1 2 1 0 1 2 1 0 1 0 2 1 1 2 1 ...
output:
67589
result:
ok 1 number(s): "67589"
Test #18:
score: 0
Accepted
time: 13ms
memory: 4944kb
input:
250000 255000 1 1 2 0 2 0 1 2 1 1 1 2 2 1 0 1 1 2 2 2 0 2 0 1 0 0 0 2 0 1 2 1 2 2 2 1 2 2 0 2 1 2 0 0 0 1 1 1 1 2 1 0 1 2 1 1 2 2 1 0 0 1 1 2 0 1 2 0 1 0 1 2 2 0 2 1 2 1 0 1 0 0 2 1 2 0 1 1 2 1 0 2 0 0 1 2 0 1 1 2 0 0 2 2 0 2 1 0 0 1 0 1 2 1 2 2 1 1 2 2 0 1 2 2 2 0 2 1 0 2 0 1 1 0 0 2 1 0 2 0 1 0 2 ...
output:
58903
result:
ok 1 number(s): "58903"
Test #19:
score: 0
Accepted
time: 10ms
memory: 5028kb
input:
250000 257500 0 1 1 1 2 0 2 0 2 0 0 0 0 0 1 1 0 0 1 1 2 0 1 2 2 1 0 0 0 2 0 2 1 1 0 0 2 0 2 2 0 2 2 2 2 2 2 1 2 2 2 0 2 0 0 2 1 0 0 1 0 0 0 1 0 2 2 1 2 2 1 2 1 0 0 0 2 2 0 1 0 2 1 2 1 1 2 0 0 0 1 0 2 1 1 1 2 2 2 1 1 1 1 0 1 0 2 1 2 1 2 1 1 2 2 0 1 2 0 2 1 0 0 0 2 0 1 2 2 0 0 2 2 1 0 2 1 1 0 0 2 0 2 ...
output:
246014
result:
ok 1 number(s): "246014"
Test #20:
score: 0
Accepted
time: 10ms
memory: 4948kb
input:
250000 260000 2 2 0 1 2 0 1 2 2 1 0 2 2 2 0 0 0 0 0 0 1 2 0 2 1 0 2 1 1 2 2 1 2 1 0 1 1 1 0 0 2 2 1 1 0 1 0 0 1 2 2 1 1 2 2 1 0 2 1 0 1 1 2 1 1 0 1 2 0 0 0 0 1 2 0 2 2 2 1 2 2 0 1 1 0 2 1 0 1 1 2 1 1 1 1 1 0 1 0 2 1 0 0 0 1 2 2 1 0 2 0 0 1 0 2 2 2 2 0 2 1 1 0 2 0 1 1 1 1 2 2 0 1 0 2 2 1 0 2 2 0 2 1 ...
output:
9416
result:
ok 1 number(s): "9416"
Test #21:
score: 0
Accepted
time: 16ms
memory: 5072kb
input:
250000 300000 1 0 2 1 1 2 0 2 1 1 2 2 2 0 2 0 0 1 1 1 2 2 1 2 0 1 1 2 1 2 1 0 0 0 1 0 0 2 1 1 1 2 2 1 2 1 0 0 1 2 1 0 0 2 2 2 0 1 2 2 0 1 1 2 0 1 2 0 2 1 1 0 1 2 1 1 0 0 0 1 1 1 1 1 0 1 0 0 1 0 0 0 0 0 0 1 1 0 0 1 1 2 1 1 0 0 0 1 2 2 2 1 2 1 0 2 2 2 1 0 0 1 2 1 1 0 0 1 1 1 2 1 1 0 0 1 1 1 1 2 1 1 1 ...
output:
237910
result:
ok 1 number(s): "237910"
Test #22:
score: 0
Accepted
time: 20ms
memory: 4920kb
input:
250000 350000 2 0 2 1 2 0 0 1 0 1 0 2 0 0 0 0 2 2 0 0 0 1 2 1 1 2 0 2 2 0 0 2 0 0 1 1 1 0 0 2 1 2 0 0 0 1 0 1 2 1 1 1 0 2 2 0 0 0 2 0 0 0 2 2 1 2 0 0 1 2 1 2 2 0 1 2 2 2 1 1 2 0 1 2 2 1 2 1 0 0 2 2 1 2 0 2 0 1 1 0 0 0 1 2 2 1 0 2 1 1 2 2 2 1 0 0 0 0 1 0 2 1 2 1 2 0 0 0 2 0 2 0 0 2 1 1 0 1 2 2 0 1 2 ...
output:
28823
result:
ok 1 number(s): "28823"
Test #23:
score: 0
Accepted
time: 25ms
memory: 5024kb
input:
250000 400000 2 1 2 0 0 0 2 1 0 1 2 2 2 0 0 0 0 0 0 1 0 0 1 0 1 1 2 2 2 1 2 2 2 0 2 0 0 0 0 1 0 2 2 1 1 0 0 0 0 1 0 0 1 2 0 2 2 2 1 2 0 2 2 1 2 0 2 2 0 0 1 1 2 0 1 2 1 1 0 1 1 2 0 0 2 1 2 0 0 2 2 0 0 0 0 2 1 0 1 1 2 0 0 0 2 0 1 0 0 0 2 2 0 1 0 1 0 0 2 0 0 1 1 1 2 0 0 1 0 2 2 2 0 0 0 0 0 2 2 0 0 2 1 ...
output:
247227
result:
ok 1 number(s): "247227"
Test #24:
score: 0
Accepted
time: 19ms
memory: 4948kb
input:
250000 450000 1 2 0 0 0 1 0 1 1 2 2 0 0 2 1 1 0 0 0 2 1 2 1 1 0 1 2 0 1 2 0 0 2 1 0 0 0 1 0 0 0 0 2 1 2 2 1 2 0 2 1 2 2 2 1 1 2 0 2 2 1 0 1 0 2 2 1 0 2 2 0 0 0 1 2 2 1 2 1 1 1 2 1 1 0 0 2 1 2 2 0 0 0 0 2 0 2 2 0 2 0 2 1 1 1 0 1 0 1 0 2 0 1 1 0 1 2 1 2 2 1 2 1 2 1 2 2 1 0 1 1 2 1 2 0 1 1 1 1 2 0 0 1 ...
output:
67494
result:
ok 1 number(s): "67494"
Test #25:
score: 0
Accepted
time: 28ms
memory: 6044kb
input:
250000 500000 1 1 0 1 0 1 0 1 2 2 0 0 0 1 0 2 2 2 0 0 2 0 2 1 1 0 2 0 0 0 2 2 2 1 1 0 1 2 0 2 2 1 0 2 2 0 0 2 2 0 0 0 1 0 2 0 1 2 0 1 1 1 1 0 2 0 0 1 1 1 1 2 0 2 2 1 1 1 2 1 2 0 0 0 1 0 0 2 0 2 2 0 0 1 0 1 1 0 1 1 1 0 2 1 1 1 0 0 1 2 1 0 0 0 0 1 0 0 0 0 2 1 2 2 1 1 1 1 0 1 0 0 2 1 1 2 2 0 2 2 0 2 2 ...
output:
118087
result:
ok 1 number(s): "118087"
Test #26:
score: 0
Accepted
time: 31ms
memory: 5188kb
input:
300000 500000 0 2 1 0 1 2 0 0 2 2 0 0 2 0 2 1 2 2 2 2 2 2 2 2 1 1 0 2 1 0 2 1 1 0 0 0 1 2 0 2 0 1 1 2 0 1 1 0 1 1 0 1 0 2 2 1 2 0 0 0 2 0 2 0 1 1 2 2 0 1 2 1 2 2 0 2 1 1 2 2 2 0 2 2 2 1 0 0 0 2 1 0 1 0 2 0 1 1 2 1 1 0 0 2 1 2 2 2 0 2 2 2 1 1 1 2 2 0 0 2 0 2 1 1 2 2 2 1 2 0 1 0 1 2 1 0 2 1 2 2 2 2 1 ...
output:
277224
result:
ok 1 number(s): "277224"
Test #27:
score: 0
Accepted
time: 24ms
memory: 5740kb
input:
400000 500000 0 1 0 1 0 0 0 1 0 1 0 2 1 0 2 2 1 1 1 0 2 1 2 2 1 0 0 1 2 1 1 2 0 2 0 0 1 2 1 1 0 2 2 0 2 0 0 2 0 1 1 2 1 2 2 0 1 2 0 1 0 2 2 1 0 0 0 1 1 2 0 0 2 2 0 0 0 2 0 0 2 1 2 1 1 1 1 2 2 0 1 2 0 2 0 2 1 2 1 2 1 0 0 0 0 0 2 2 1 2 2 0 0 2 1 2 1 2 2 0 1 2 0 1 2 1 2 2 0 2 2 2 2 0 2 2 0 2 1 0 2 1 2 ...
output:
208631
result:
ok 1 number(s): "208631"
Test #28:
score: 0
Accepted
time: 23ms
memory: 6132kb
input:
500000 500000 1 2 0 0 2 1 0 2 1 1 2 1 0 1 1 2 2 2 1 0 1 1 2 2 0 1 1 0 0 0 2 1 2 1 1 1 1 0 2 1 2 2 1 1 2 2 0 0 1 2 1 2 2 2 0 2 0 0 2 2 2 2 0 2 2 2 2 2 0 2 2 0 2 0 0 2 1 0 0 0 0 2 2 1 2 2 1 2 2 0 0 1 2 1 1 2 1 1 2 2 0 1 2 1 1 0 2 1 2 1 1 2 1 1 0 1 2 1 2 1 0 0 0 2 1 2 2 0 0 1 1 0 1 1 1 0 1 1 1 2 2 1 2 ...
output:
302244
result:
ok 1 number(s): "302244"
Test #29:
score: 0
Accepted
time: 0ms
memory: 3856kb
input:
1 0 0
output:
1
result:
ok 1 number(s): "1"
Test #30:
score: 0
Accepted
time: 1ms
memory: 5832kb
input:
100 99 2 2 2 2 1 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 2 2 2 2 2 2 2 2 2 2 2 2 2 0 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 2 2 2 2 2 2 2 5 99 5 81 5 10 5 98 5 100 5 51 5 30 5 43 5 54 5 46 5 67 5 8 5 17 5 63 5 82 5 35 5 44 5 2 5 94...
output:
56
result:
ok 1 number(s): "56"
Test #31:
score: 0
Accepted
time: 0ms
memory: 3756kb
input:
1000 999 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 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 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 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...
output:
984
result:
ok 1 number(s): "984"
Test #32:
score: 0
Accepted
time: 1ms
memory: 3776kb
input:
10000 9999 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 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 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 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...
output:
4988
result:
ok 1 number(s): "4988"
Test #33:
score: 0
Accepted
time: 4ms
memory: 4236kb
input:
100000 99999 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 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 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 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...
output:
47630
result:
ok 1 number(s): "47630"
Test #34:
score: 0
Accepted
time: 25ms
memory: 6240kb
input:
500000 499999 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 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 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 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 ...
output:
137055
result:
ok 1 number(s): "137055"
Test #35:
score: 0
Accepted
time: 20ms
memory: 6168kb
input:
500000 499999 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 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 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 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 ...
output:
46758
result:
ok 1 number(s): "46758"
Test #36:
score: 0
Accepted
time: 21ms
memory: 6240kb
input:
500000 499999 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 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 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 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 ...
output:
322304
result:
ok 1 number(s): "322304"
Test #37:
score: 0
Accepted
time: 15ms
memory: 4976kb
input:
250000 249999 1 1 0 2 2 1 0 0 1 2 2 0 2 0 2 0 1 0 2 2 2 0 2 0 2 2 0 2 2 0 2 0 0 1 1 1 0 2 1 2 2 2 1 0 0 2 0 1 2 0 2 2 0 2 0 1 0 2 1 0 0 2 0 1 2 2 0 2 1 0 1 2 2 2 1 0 1 0 0 2 1 0 2 2 0 2 2 1 1 0 2 2 1 1 0 2 1 1 2 0 0 2 0 2 0 0 1 1 0 0 2 0 1 1 1 2 2 0 0 1 1 0 2 2 0 2 0 2 2 1 1 0 0 2 2 1 0 2 2 0 2 2 0 ...
output:
180263
result:
ok 1 number(s): "180263"
Test #38:
score: 0
Accepted
time: 7ms
memory: 6012kb
input:
250000 250000 2 1 0 1 2 2 0 0 1 1 1 1 2 0 0 2 1 0 1 0 0 1 2 2 1 0 1 0 1 1 2 0 0 2 2 0 0 0 2 2 1 0 0 0 0 2 0 0 0 1 0 1 2 2 2 1 2 1 2 1 1 2 0 1 0 2 0 2 0 0 2 2 0 2 2 1 2 1 1 1 2 0 2 1 0 0 2 1 2 2 1 1 0 2 0 2 0 1 1 2 2 0 0 2 0 0 2 0 1 1 2 2 1 2 2 2 2 1 0 2 1 0 2 1 2 0 2 2 2 0 1 1 0 0 1 1 2 0 2 0 0 2 2 ...
output:
22413
result:
ok 1 number(s): "22413"
Test #39:
score: 0
Accepted
time: 22ms
memory: 6144kb
input:
250000 400000 1 0 2 0 1 2 0 0 1 2 2 2 1 2 0 0 1 2 0 0 2 0 0 1 1 2 2 2 1 2 0 2 1 0 0 0 1 2 0 0 0 2 0 0 0 1 1 1 1 2 1 2 2 1 0 1 2 0 0 1 2 2 2 0 2 1 0 0 1 2 2 2 2 0 0 1 2 2 0 2 0 2 1 2 1 2 2 0 1 1 0 0 2 2 2 2 0 2 2 1 0 2 0 2 1 2 2 2 1 2 0 1 1 2 2 2 0 2 0 1 2 0 2 2 0 1 2 0 0 0 2 0 0 2 1 2 1 1 1 0 2 2 2 ...
output:
101763
result:
ok 1 number(s): "101763"
Test #40:
score: 0
Accepted
time: 30ms
memory: 4940kb
input:
250000 500000 2 1 0 1 1 1 0 1 1 2 2 0 2 2 1 0 1 1 1 1 0 1 2 2 2 1 1 0 0 0 2 0 0 1 2 0 1 2 0 0 0 0 2 2 1 2 1 2 1 1 1 0 1 0 0 1 0 1 0 0 2 2 2 2 2 2 1 1 0 0 0 0 1 0 1 1 0 0 2 0 0 0 1 1 0 0 0 1 1 2 2 2 0 2 0 2 1 0 0 1 2 1 1 0 0 2 1 2 1 2 0 0 1 0 1 1 1 0 1 0 1 0 0 1 1 1 0 2 0 2 1 0 2 1 2 0 1 1 0 2 1 0 0 ...
output:
164561
result:
ok 1 number(s): "164561"
Test #41:
score: 0
Accepted
time: 26ms
memory: 6284kb
input:
500000 499999 2 2 1 0 1 2 0 2 1 0 2 2 2 0 2 1 0 0 1 0 0 0 2 0 0 2 0 1 0 1 0 1 0 1 2 1 0 0 2 0 2 2 2 0 0 2 2 1 2 0 1 0 2 1 0 0 1 2 2 0 2 2 0 0 1 1 1 1 2 2 2 2 2 1 2 1 0 0 1 0 1 2 0 1 1 0 0 0 1 2 1 2 2 0 0 1 2 1 0 0 2 1 0 0 0 2 1 0 1 2 0 0 1 1 1 0 0 1 1 0 2 2 1 1 2 0 0 1 1 2 2 1 1 0 1 2 1 1 2 2 0 0 2 ...
output:
448614
result:
ok 1 number(s): "448614"
Test #42:
score: 0
Accepted
time: 21ms
memory: 6176kb
input:
500000 500000 0 2 2 1 0 2 2 1 2 0 2 2 1 2 2 0 1 2 1 1 0 0 2 0 1 2 1 0 2 1 0 0 1 0 0 2 2 1 2 0 2 2 2 0 0 1 2 2 0 0 1 1 2 0 2 2 1 1 0 2 2 2 2 2 2 2 1 0 2 2 2 0 1 2 2 1 0 1 0 1 0 1 1 0 0 0 2 1 0 2 1 0 1 1 0 2 0 1 0 1 1 1 1 1 2 1 1 1 2 0 2 2 1 2 2 0 2 2 2 0 2 1 0 0 1 0 1 1 2 0 1 2 1 1 2 0 1 1 0 2 1 2 2 ...
output:
41021
result:
ok 1 number(s): "41021"
Test #43:
score: 0
Accepted
time: 11ms
memory: 5024kb
input:
250000 249999 0 2 1 1 2 1 2 2 0 2 1 0 0 0 1 2 1 1 1 0 0 0 0 0 1 2 0 2 2 0 1 0 0 2 2 1 1 1 2 1 1 2 2 2 0 0 1 2 2 2 0 1 1 0 1 2 1 0 0 1 1 2 1 2 0 2 2 2 0 1 2 1 0 1 2 1 0 2 2 2 0 1 1 1 1 1 2 1 2 1 1 1 2 2 1 0 0 1 2 2 0 2 2 0 1 1 2 2 1 0 0 0 2 0 0 0 2 0 2 2 1 0 1 0 2 0 0 1 2 1 0 2 1 0 2 0 1 2 2 0 0 2 1 ...
output:
149349
result:
ok 1 number(s): "149349"
Test #44:
score: 0
Accepted
time: 12ms
memory: 5080kb
input:
250000 250000 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 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 2 2 2 2 2 2 2 0 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 2 2 2 2 2 1 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 ...
output:
96370
result:
ok 1 number(s): "96370"
Test #45:
score: 0
Accepted
time: 22ms
memory: 4912kb
input:
250000 400000 2 2 2 2 0 2 2 0 0 0 2 2 0 2 2 2 2 2 0 1 2 2 1 2 0 1 2 2 1 1 2 0 2 1 2 2 2 1 0 2 0 2 2 2 0 1 2 2 0 2 2 0 2 2 2 0 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 0 1 2 1 2 2 1 2 2 2 1 2 0 0 1 1 2 0 2 1 2 0 2 1 2 2 2 2 2 0 1 0 2 2 1 0 2 1 0 2 1 2 2 1 2 2 2 0 2 1 2 2 0 0 0 2 1 2 1 2 0 2 1 2 2 ...
output:
66931
result:
ok 1 number(s): "66931"
Test #46:
score: 0
Accepted
time: 27ms
memory: 4916kb
input:
250000 500000 1 2 2 2 2 0 2 1 0 2 0 0 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 0 2 2 2 2 2 2 2 2 2 2 2 2 0 2 2 2 2 2 2 0 1 2 2 2 2 2 2 2 2 2 2 2 0 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 0 2 2 2 2 2 2 0 2 2 2 2 2 2 2 2 2 2 0 2 2 2 2 2 2 2 2 2 2 2 2 2 0 2 2 2 2 2 ...
output:
185953
result:
ok 1 number(s): "185953"
Test #47:
score: 0
Accepted
time: 23ms
memory: 6188kb
input:
500000 499999 2 2 2 0 0 2 0 0 2 2 2 0 2 2 0 2 2 1 1 2 1 0 1 1 1 1 0 2 2 1 1 0 0 2 1 0 1 0 1 1 1 0 0 1 0 2 2 0 0 1 2 0 2 2 1 0 0 0 0 2 2 0 0 0 2 0 0 1 0 0 0 2 0 2 0 2 0 0 1 0 0 0 2 1 0 1 0 1 1 2 0 0 2 1 0 1 0 2 0 1 0 1 2 1 1 0 1 0 1 2 1 2 0 0 0 1 0 0 0 2 1 0 2 0 1 0 2 0 2 0 2 1 2 0 1 0 0 1 2 0 0 1 1 ...
output:
265842
result:
ok 1 number(s): "265842"
Test #48:
score: 0
Accepted
time: 26ms
memory: 6128kb
input:
500000 500000 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 0 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 2 2 2 2 2 2 2 2 2 2 2 0 2 0 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 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 ...
output:
263153
result:
ok 1 number(s): "263153"