QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#38147#832. Best TreeGuanYunchangWA 26ms3760kbC++11471b2022-07-04 12:12:112022-07-04 12:12:12

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3760kb

input:

2
10
1 1 2 2 2 2 2 2 2 2
5
4 1 1 1 1

output:

5
1

result:

ok 2 tokens

Test #2:

score: 0
Accepted
time: 2ms
memory: 3752kb

input:

1
2
1 1

output:

1

result:

ok "1"

Test #3:

score: 0
Accepted
time: 26ms
memory: 3732kb

input:

66666
3
1 2 1
3
1 2 1
3
1 2 1
3
1 1 2
3
2 1 1
3
1 2 1
3
1 1 2
3
1 1 2
3
2 1 1
3
2 1 1
3
1 1 2
3
1 1 2
3
1 2 1
3
1 1 2
3
1 1 2
3
1 2 1
3
1 1 2
3
1 1 2
3
1 2 1
3
2 1 1
3
2 1 1
3
1 1 2
3
2 1 1
3
2 1 1
3
1 1 2
3
1 2 1
3
2 1 1
3
2 1 1
3
1 1 2
3
1 1 2
3
1 1 2
3
1 1 2
3
1 2 1
3
2 1 1
3
2 1 1
3
1 1 2
3
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 66666 tokens

Test #4:

score: 0
Accepted
time: 19ms
memory: 3744kb

input:

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

result:

wrong answer 3rd words differ - expected: '2', found: '3'