QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#38254#840. Just CountingZhangYiDeWA 91ms10488kbC++172.2kb2022-07-04 21:29:132022-07-04 21:29:14

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 10488kb

input:

3
1 0
3 3
1 2
2 3
3 1
4 4
1 2
2 3
3 4
4 1

output:

1
1
5

result:

ok 3 number(s): "1 1 5"

Test #2:

score: 0
Accepted
time: 91ms
memory: 9824kb

input:

500000
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
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 500000 numbers

Test #3:

score: 0
Accepted
time: 45ms
memory: 10044kb

input:

250000
2 0
2 0
2 0
2 0
2 0
2 0
2 0
2 0
2 0
2 0
2 0
2 0
2 0
2 0
2 0
2 0
2 0
2 0
2 0
2 0
2 0
2 0
2 0
2 0
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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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 166666 numbers

Test #5:

score: 0
Accepted
time: 27ms
memory: 10016kb

input:

166666
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3 0
3...

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 166666 numbers

Test #6:

score: 0
Accepted
time: 43ms
memory: 9788kb

input:

125000
3 1
1 2
3 1
2 3
3 1
1 2
3 1
1 2
3 1
2 3
3 1
1 2
3 1
2 3
3 1
1 3
3 1
1 2
3 1
1 2
3 1
1 2
3 1
1 3
3 1
1 3
3 1
2 3
3 1
1 2
3 1
2 3
3 1
1 2
3 1
1 3
3 1
1 3
3 1
1 3
3 1
1 2
3 1
1 2
3 1
1 2
3 1
1 3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1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 100000 numbers

Test #8:

score: 0
Accepted
time: 37ms
memory: 8760kb

input:

83333
3 3
1 3
2 3
1 2
3 3
1 3
1 2
2 3
3 3
2 3
1 2
1 3
3 3
1 3
2 3
1 2
3 3
1 2
2 3
1 3
3 3
1 3
2 3
1 2
3 3
2 3
1 2
1 3
3 3
2 3
1 2
1 3
3 3
2 3
1 2
1 3
3 3
2 3
1 2
1 3
3 3
1 2
1 3
2 3
3 3
2 3
1 2
1 3
3 3
2 3
1 3
1 2
3 3
1 3
2 3
1 2
3 3
2 3
1 2
1 3
3 3
1 3
2 3
1 2
3 3
1 3
1 2
2 3
3 3
1 3
2 3
1 2
3 3
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 83333 numbers

Test #9:

score: 0
Accepted
time: 27ms
memory: 9224kb

input:

125000
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4 0
4...

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 125000 numbers

Test #10:

score: 0
Accepted
time: 28ms
memory: 8888kb

input:

100000
4 1
2 4
4 1
1 4
4 1
3 4
4 1
3 4
4 1
1 2
4 1
2 4
4 1
1 3
4 1
1 2
4 1
1 4
4 1
2 4
4 1
1 4
4 1
3 4
4 1
1 3
4 1
1 2
4 1
3 4
4 1
3 4
4 1
1 4
4 1
1 4
4 1
1 2
4 1
1 3
4 1
3 4
4 1
1 3
4 1
1 2
4 1
1 3
4 1
1 3
4 1
2 4
4 1
1 3
4 1
1 4
4 1
2 4
4 1
1 3
4 1
1 3
4 1
3 4
4 1
1 2
4 1
1 4
4 1
2 4
4 1
1 2
4 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 100000 numbers

Test #11:

score: 0
Accepted
time: 27ms
memory: 10004kb

input:

83333
4 2
1 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1
1
1
1
1
5
1
5
5
1
5
1
1
1
1
1
1
1
1
1
1
1
5
1
5
1
1
1
1
1
1
1
1
1
1
1
5
1
1
1
5
5
1
1
1
1
5
1
5
5
5
1
1
1
5
1
1
1
5
5
1
1
1
5
1
1
1
1
1
1
1
1
1
5
1
5
1
1
1
1
1
1
1
1
5
5
5
5
1
1
1
1
1
5
1
5
1
1
1
1
1
1
5
1
1
5
5
1
1
5
1
5
1
...

result:

wrong answer 3rd numbers differ - expected: '1', found: '5'