QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#111570#6502. Disjoint Set UnionFantasy_BallWA 188ms3688kbC++141.6kb2023-06-07 16:31:212023-06-07 16:31:25

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

5
3
1 2 3
2 2 3
4
1 2 3 3
1 1 1 2
5
1 2 3 4 5
2 3 4 5 5
5
1 1 1 1 1
1 2 3 4 5
6
1 2 2 4 5 6
1 1 5 1 4 2

output:

YES
3
1 1
1 1
2 1 2
YES
14
1 2
1 3
1 4
1 2
1 3
1 4
2 3 2
1 2
1 3
1 4
1 2
1 3
2 2 1
1 3
YES
18
1 1
1 2
1 3
1 4
1 1
1 2
1 3
1 4
2 1 2
1 2
1 3
1 4
2 2 3
1 3
1 4
2 3 4
1 4
2 4 5
NO
YES
30
1 2
1 3
1 4
1 5
1 6
1 2
1 3
1 4
1 5
1 6
1 2
1 3
1 4
1 5
1 6
2 6 2
1 2
1 3
1 4
1 5
2 2 5
1 2
1 3
1 4
1 5
2 5 4
1 2
1 ...

result:

ok good! (YES count = 4, NO count = 1) (5 test cases)

Test #2:

score: -100
Wrong Answer
time: 188ms
memory: 3656kb

input:

100000
5
1 2 1 1 1
2 2 1 1 2
5
3 2 3 4 1
3 2 3 4 1
5
1 2 3 4 3
1 4 4 1 1
5
1 2 3 5 3
1 2 2 5 2
5
5 2 3 5 5
5 2 3 5 5
5
1 2 3 4 5
5 3 3 4 5
5
1 2 3 4 5
1 4 1 4 4
5
1 2 3 1 5
1 2 3 1 2
5
1 2 3 3 1
1 3 3 3 1
5
1 2 3 4 3
2 2 4 4 4
5
1 2 2 4 5
5 2 2 4 5
5
1 2 1 4 5
5 2 5 5 5
5
1 2 3 4 5
1 2 5 5 1
5
1 4 3...

output:

YES
6
1 1
1 5
1 1
1 5
2 1 2
1 5
YES
0
YES
19
1 2
1 3
1 4
1 5
1 2
1 3
1 4
1 5
2 2 4
1 3
1 4
1 5
2 3 4
1 4
1 5
1 4
1 5
2 4 1
1 5
YES
8
1 3
1 5
1 3
1 5
1 3
1 5
2 3 2
1 5
YES
0
YES
7
1 1
1 2
1 1
1 2
2 1 5
1 2
2 2 3
YES
12
1 2
1 3
1 5
1 2
1 3
1 5
2 2 4
1 3
1 5
2 3 1
1 5
2 5 4
YES
6
1 5
1 5
1 5
1 5
1 5
2 ...

result:

wrong answer you didn't find a solution but jury did (test case 5184)