QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#364816#6396. Puzzle: Kusabiucup-team2253WA 153ms38776kbC++173.4kb2024-03-24 16:49:182024-03-24 16:49:19

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 3ms
memory: 17664kb

input:

8
2 1 -
3 1 -
4 2 Tong
5 2 Tong
6 3 Duan
7 3 -
8 7 Chang

output:

YES
5 4
8 6

result:

ok Correct.

Test #2:

score: 0
Accepted
time: 7ms
memory: 17704kb

input:

10
2 1 Duan
3 2 Duan
4 2 -
5 4 Chang
6 2 Chang
7 1 Duan
8 6 Tong
9 6 Tong
10 3 Chang

output:

YES
9 8
10 3
2 6
5 7

result:

ok Correct.

Test #3:

score: 0
Accepted
time: 3ms
memory: 17972kb

input:

2
2 1 Tong

output:

NO

result:

ok Correct.

Test #4:

score: 0
Accepted
time: 147ms
memory: 37512kb

input:

100000
2 1 Duan
3 1 Duan
4 3 -
5 4 Duan
6 3 -
7 4 Duan
8 4 -
9 8 -
10 7 Duan
11 9 -
12 7 Duan
13 7 Duan
14 8 Duan
15 13 -
16 10 Duan
17 11 Duan
18 12 -
19 1 Duan
20 5 Duan
21 4 Duan
22 14 Duan
23 16 -
24 22 Duan
25 16 Duan
26 13 -
27 13 -
28 17 -
29 5 Duan
30 22 -
31 23 -
32 9 Duan
33 5 -
34 30 Duan...

output:

YES
78961 61327
92416 71315
47332 33659
78872 62962
42110 20744
97640 58531
95031 27446
24772 3681
15911 79799
76595 61255
98939 44448
72730 8187
78097 76428
85390 65956
18457 14565
91535 53748
67893 61324
41920 12963
40779 5978
78242 66078
52767 23420
61950 35692
66591 26692
41308 8200
74654 51749
...

result:

ok Correct.

Test #5:

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

input:

100000
2 1 -
3 2 -
4 3 -
5 4 -
6 4 -
7 6 -
8 7 -
9 5 -
10 9 -
11 10 -
12 6 -
13 12 -
14 11 -
15 9 -
16 14 -
17 16 -
18 10 -
19 15 -
20 13 -
21 20 -
22 17 -
23 22 -
24 22 Duan
25 11 -
26 12 -
27 20 -
28 18 -
29 28 -
30 16 -
31 28 -
32 30 -
33 31 -
34 28 -
35 34 -
36 35 -
37 22 -
38 34 -
39 38 -
40 35...

output:

YES
37144 5364
3704 5004
97538 90735
98308 78598
79958 48929
90722 46933
71716 63753
52721 98336
59347 29986
65733 81832
56153 45396
69473 58166
83306 68562
90372 88026
21350 49414
84631 41691
89202 84788
57257 56790
74096 79552
43168 74763
83961 53053
22158 17151
65562 48113
94984 88647
89798 92062...

result:

ok Correct.

Test #6:

score: 0
Accepted
time: 133ms
memory: 38776kb

input:

100000
2 1 -
3 2 -
4 3 Duan
5 4 Chang
6 5 Duan
7 6 Chang
8 7 Duan
9 8 Chang
10 9 Duan
11 10 Chang
12 11 Duan
13 12 Chang
14 12 Duan
15 14 Chang
16 15 Tong
17 15 Tong
18 17 Duan
19 18 Duan
20 19 Chang
21 18 Duan
22 21 Duan
23 18 Chang
24 21 -
25 24 Duan
26 25 Chang
27 26 Duan
28 27 Chang
29 26 Duan
3...

output:

YES
524 510
1413 1428
1350 1181
1040 1008
2293 2431
5155 4744
10291 9835
7461 8265
16801 21461
6783 7800
5478 4788
3720 3705
16751 16475
13920 16924
13739 16608
11695 10961
29385 29052
24590 29299
81180 73995
70932 70563
72818 53442
81032 75175
71794 86654
52919 45637
49360 43836
42536 41279
45005 4...

result:

ok Correct.

Test #7:

score: 0
Accepted
time: 95ms
memory: 36700kb

input:

100000
2 1 -
3 2 -
4 3 -
5 4 -
6 5 -
7 6 -
8 7 -
9 8 -
10 9 Duan
11 10 -
12 11 Chang
13 12 Duan
14 13 Chang
15 14 -
16 15 -
17 16 Duan
18 17 Chang
19 17 -
20 19 -
21 20 -
22 21 -
23 22 -
24 23 -
25 24 -
26 25 Duan
27 26 -
28 27 Duan
29 28 -
30 29 Chang
31 28 -
32 31 Chang
33 32 -
34 32 -
35 34 -
36 ...

output:

YES
286 279
262 260
579 562
409 385
375 386
486 479
3328 3230
3177 3084
3518 3304
7564 7541
61367 45631
95979 94913
91068 89297
91209 87610
40600 38972
36114 35976
32514 33052
17565 17203
16691 16281
11094 11071
10114 9912
9567 10637
8457 9335
9379 9289
25285 23326
7535 7105
6176 6000
21161 21040
13...

result:

ok Correct.

Test #8:

score: 0
Accepted
time: 103ms
memory: 37136kb

input:

100000
2 1 -
3 2 -
4 3 -
5 4 -
6 5 Duan
7 6 -
8 7 -
9 8 -
10 9 Chang
11 10 -
12 11 Duan
13 12 Chang
14 13 -
15 14 Duan
16 15 Chang
17 16 -
18 17 -
19 18 Duan
20 19 -
21 20 -
22 21 -
23 22 Chang
24 23 -
25 24 Duan
26 25 -
27 26 Chang
28 27 -
29 28 -
30 29 -
31 30 Duan
32 31 -
33 32 -
34 33 -
35 34 -
...

output:

YES
430 424
353 383
429 422
707 699
787 778
757 755
1098 1097
1331 1295
1402 1388
1838 1824
1575 1573
2020 1982
2122 2126
2026 2022
2168 2223
2058 2053
3060 3026
2892 2883
3528 3465
5063 4996
4962 4946
5053 5051
5511 5368
6768 6738
12073 11984
11517 11426
15862 15724
15871 16044
16029 16010
13245 13...

result:

ok Correct.

Test #9:

score: 0
Accepted
time: 99ms
memory: 37856kb

input:

100000
2 1 -
3 2 -
4 3 -
5 4 -
6 5 Duan
7 6 -
8 7 -
9 8 Chang
10 9 -
11 10 Duan
12 11 -
13 12 Chang
14 13 Duan
15 14 -
16 15 Chang
17 16 -
18 17 Duan
19 18 -
20 19 Chang
21 20 Duan
22 21 Chang
23 22 -
24 23 Duan
25 24 Chang
26 25 Duan
27 26 -
28 27 -
29 28 Chang
30 29 Duan
31 30 Chang
32 31 -
33 32 ...

output:

YES
738 737
1157 1154
1170 1165
1216 1220
1457 1454
1448 1450
1605 1608
1810 1832
1800 1795
2235 2242
2334 2309
2797 2772
3020 3016
2852 2851
2904 2902
3084 3076
3044 3031
3018 3025
3045 3040
3214 3212
3224 3219
3339 3299
3616 3603
3631 3607
3668 3659
3676 3663
3695 3703
3737 3733
3876 3873
3963 393...

result:

ok Correct.

Test #10:

score: 0
Accepted
time: 58ms
memory: 36452kb

input:

100000
2 1 -
3 2 -
4 3 -
5 4 -
6 5 -
7 6 -
8 7 -
9 8 -
10 9 -
11 10 -
12 11 -
13 12 -
14 13 -
15 14 -
16 15 -
17 16 -
18 17 -
19 18 -
20 19 -
21 20 -
22 21 -
23 22 -
24 23 -
25 24 -
26 25 -
27 26 -
28 27 -
29 28 -
30 29 -
31 30 -
32 31 -
33 32 -
34 33 -
35 34 -
36 35 -
37 36 -
38 37 -
39 38 -
40 39 ...

output:

YES
35551 35528
85950 86202
46361 46356
4774 4758
6738 6570
12004 11802
15175 15095
16272 16218
15813 15803
17703 17698
18828 18616
20553 20479
22767 22709
25371 24981
24571 23807
23781 23319
28616 28570
27425 26536
29756 29047
30157 29822
29413 29383
31800 31792
34909 34775
34774 33210
33101 33062
...

result:

ok Correct.

Test #11:

score: 0
Accepted
time: 128ms
memory: 35740kb

input:

100000
2 1 -
3 1 -
4 2 -
5 1 -
6 1 -
7 2 Duan
8 4 -
9 1 -
10 1 -
11 2 -
12 2 -
13 2 -
14 6 -
15 1 -
16 6 -
17 1 -
18 5 -
19 1 -
20 1 -
21 2 -
22 8 -
23 6 -
24 1 -
25 4 Duan
26 1 -
27 10 -
28 1 -
29 8 -
30 5 -
31 7 -
32 2 -
33 3 -
34 12 -
35 3 -
36 1 -
37 12 -
38 8 -
39 8 -
40 1 -
41 4 -
42 16 -
43 8...

output:

YES
24625 36459
51360 12629
66179 40633
77789 24756
48087 43166
40062 39212
57016 26357
64410 49932
62888 44653
54988 69476
34629 12680
93996 80336
83954 54631
72055 39440
24774 16971
62379 39572
54804 93177
30597 49129
88460 36894
51492 30724
14531 27901
53689 28655
89547 70073
66411 57242
89634 55...

result:

ok Correct.

Test #12:

score: 0
Accepted
time: 103ms
memory: 35588kb

input:

100000
2 1 -
3 1 -
4 1 -
5 1 -
6 1 -
7 1 -
8 1 -
9 1 -
10 3 -
11 1 -
12 2 -
13 2 -
14 2 -
15 1 -
16 2 -
17 2 -
18 1 -
19 1 -
20 1 -
21 2 -
22 1 -
23 2 -
24 2 -
25 1 -
26 1 -
27 4 -
28 1 -
29 2 -
30 3 -
31 1 -
32 10 -
33 6 -
34 4 -
35 1 -
36 2 Duan
37 1 -
38 4 -
39 10 -
40 1 -
41 1 -
42 3 -
43 6 -
44...

output:

YES
89903 67589
39272 68594
81476 15090
71809 60781
6696 52694
39450 53733
38667 9364
93654 56621
56831 78483
26050 70164
82381 23972
93029 56644
96431 59869
16173 48623
11622 69879
61067 65091
97866 50064
17431 40767
66474 30022
94704 56465
51438 91780
99631 76670
36526 81510
38696 54945
67890 5756...

result:

ok Correct.

Test #13:

score: 0
Accepted
time: 153ms
memory: 38108kb

input:

100000
2 1 Duan
3 1 Duan
4 1 Duan
5 1 Duan
6 1 Duan
7 1 -
8 1 Duan
9 1 Duan
10 1 -
11 1 Duan
12 1 -
13 1 Duan
14 1 Duan
15 1 Duan
16 1 Duan
17 1 Duan
18 2 -
19 1 Duan
20 1 Duan
21 2 -
22 2 Duan
23 1 Duan
24 1 Duan
25 1 Duan
26 1 Duan
27 2 Duan
28 1 Duan
29 2 Duan
30 1 Duan
31 2 Duan
32 1 -
33 1 Duan...

output:

YES
91412 24883
85955 13639
22212 33335
97480 35159
45927 71589
37328 50813
89522 74905
55077 93406
55068 43510
99420 38839
37375 30018
8207 16232
45202 19798
79738 21535
24169 25264
46503 33395
91816 90487
69419 58609
98717 77936
57836 53262
47484 85424
84824 36040
29503 48708
14724 60312
22670 860...

result:

ok Correct.

Test #14:

score: 0
Accepted
time: 122ms
memory: 36508kb

input:

100000
2 1 -
3 1 -
4 1 -
5 1 -
6 1 -
7 1 -
8 1 -
9 1 -
10 1 -
11 1 -
12 1 -
13 1 Duan
14 1 -
15 1 -
16 1 -
17 1 -
18 1 -
19 1 -
20 1 -
21 1 -
22 1 -
23 1 -
24 1 -
25 1 -
26 1 -
27 1 -
28 1 -
29 1 Duan
30 1 -
31 1 -
32 2 Duan
33 1 -
34 1 -
35 1 Duan
36 1 -
37 1 -
38 1 -
39 1 -
40 1 -
41 1 -
42 1 -
43...

output:

YES
66929 95552
73534 81453
70004 69029
83456 81725
50102 45455
19960 16997
23609 51615
36674 62131
38786 44070
81033 47632
19935 8378
81272 59014
50668 72824
28348 83388
10617 77119
63648 83713
37654 38769
55371 51456
58136 80843
68781 74365
98528 66899
21156 27042
5452 79274
23421 11930
37457 6055...

result:

ok Correct.

Test #15:

score: 0
Accepted
time: 117ms
memory: 36756kb

input:

100000
2 1 Duan
3 1 -
4 1 -
5 1 Duan
6 1 -
7 1 -
8 1 -
9 1 -
10 1 -
11 1 -
12 1 -
13 1 -
14 1 -
15 1 -
16 1 -
17 1 -
18 1 -
19 1 -
20 1 -
21 1 -
22 1 -
23 1 -
24 1 -
25 1 -
26 1 -
27 1 -
28 1 -
29 1 -
30 1 -
31 1 -
32 1 -
33 1 Duan
34 1 -
35 1 -
36 1 -
37 1 -
38 1 -
39 1 -
40 1 -
41 1 -
42 1 -
43 1 ...

output:

YES
81529 67080
96779 96324
81594 44807
93130 77746
95680 70258
98806 96868
95579 63689
83651 72275
92136 87183
85430 89116
96722 58256
99461 99289
53373 93152
75851 69273
33720 53725
22407 76940
44782 73938
96826 76846
92928 81411
66822 75168
74970 19863
64377 40265
76646 24515
80128 33693
70668 71...

result:

ok Correct.

Test #16:

score: 0
Accepted
time: 139ms
memory: 37876kb

input:

100000
2 1 Duan
3 1 Duan
4 1 -
5 1 Duan
6 1 -
7 1 Duan
8 1 Duan
9 1 Duan
10 1 Duan
11 1 -
12 1 -
13 1 -
14 1 Duan
15 1 Duan
16 1 Duan
17 1 -
18 1 Duan
19 1 Duan
20 1 Duan
21 1 -
22 1 -
23 1 Duan
24 1 Duan
25 1 Duan
26 1 -
27 1 -
28 1 Duan
29 1 Duan
30 1 -
31 1 Duan
32 1 Duan
33 1 -
34 1 Duan
35 1 -
...

output:

YES
99538 89169
94865 70230
79579 67510
72188 67027
93180 87106
84255 89663
82529 82112
37396 72639
85868 78040
57276 69028
99319 95605
90324 87186
57132 89175
91368 53018
20476 89224
63062 42452
78387 68143
42445 82034
69027 59794
79254 83490
99297 97482
97324 91080
90731 86476
63617 63175
48524 70...

result:

ok Correct.

Test #17:

score: -100
Wrong Answer
time: 101ms
memory: 35500kb

input:

100000
2 1 -
3 1 -
4 2 -
5 2 -
6 2 Duan
7 3 -
8 1 -
9 1 -
10 6 -
11 3 -
12 2 -
13 7 -
14 1 -
15 9 -
16 11 -
17 13 -
18 9 -
19 16 -
20 19 -
21 8 -
22 5 -
23 14 -
24 21 -
25 21 -
26 16 -
27 5 -
28 5 -
29 19 -
30 8 -
31 24 -
32 30 -
33 12 Duan
34 9 -
35 12 Duan
36 6 -
37 15 -
38 26 -
39 29 -
40 13 -
41...

output:

ans.size()=6725
ans.size()=6731
ans.size()=6732
ans.size()=6733
ans.size()=6733
ans.size()=6734
NO

result:

wrong answer YES or NO expected in answer, but ANS.SIZE()=6725 found.