QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#515536#4930. LCS of Permutationsegypt_ioi2024_01#20 51ms3720kbC++232.3kb2024-08-11 18:25:212024-08-11 18:25:22

详细

Subtask #1:

score: 3
Accepted

Test #1:

score: 3
Accepted
time: 23ms
memory: 3640kb

input:

632
512 1 1 512 1
201 1 1 201 1
155 1 1 155 1
129 1 1 129 1
345 1 1 345 1
454 1 1 454 1
614 1 1 614 1
11 1 1 11 1
492 1 1 492 1
357 1 1 357 1
300 1 1 300 1
295 1 1 295 1
607 1 1 607 1
442 1 1 442 1
14 1 1 14 1
79 1 1 79 1
584 1 1 584 1
431 1 1 431 1
343 1 1 343 1
64 1 1 64 1
548 1 1 548 1
101 1 1 10...

output:

YES
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...

result:

ok Correct (632 test cases)

Test #2:

score: 3
Accepted
time: 23ms
memory: 3620kb

input:

1
200000 1 1 200000 1

output:

YES
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...

result:

ok Correct (1 test case)

Test #3:

score: 3
Accepted
time: 23ms
memory: 3632kb

input:

2
118278 1 1 118278 1
81722 1 1 81722 1

output:

YES
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...

result:

ok Correct (2 test cases)

Test #4:

score: 3
Accepted
time: 23ms
memory: 3636kb

input:

5
24223 1 1 24223 1
41513 1 1 41513 1
15442 1 1 15442 1
19470 1 1 19470 1
99352 1 1 99352 1

output:

YES
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...

result:

ok Correct (5 test cases)

Test #5:

score: 3
Accepted
time: 27ms
memory: 3588kb

input:

20
11481 1 1 11481 1
53318 1 1 53318 1
13359 1 1 13359 1
8929 1 1 8929 1
15918 1 1 15918 1
509 1 1 509 1
11385 1 1 11385 1
10829 1 1 10829 1
5628 1 1 5628 1
1270 1 1 1270 1
2232 1 1 2232 1
3011 1 1 3011 1
4020 1 1 4020 1
23225 1 1 23225 1
215 1 1 215 1
1094 1 1 1094 1
10463 1 1 10463 1
708 1 1 708 1...

output:

YES
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...

result:

ok Correct (20 test cases)

Test #6:

score: 3
Accepted
time: 26ms
memory: 3632kb

input:

100
1273 1 1 1273 1
1503 1 1 1503 1
2935 1 1 2935 1
4875 1 1 4875 1
2328 1 1 2328 1
2048 1 1 2048 1
4128 1 1 4128 1
2855 1 1 2855 1
6624 1 1 6624 1
2447 1 1 2447 1
2266 1 1 2266 1
1875 1 1 1875 1
2960 1 1 2960 1
2432 1 1 2432 1
8 1 1 8 1
516 1 1 516 1
127 1 1 127 1
5844 1 1 5844 1
2060 1 1 2060 1
10...

output:

YES
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...

result:

ok Correct (100 test cases)

Test #7:

score: 3
Accepted
time: 29ms
memory: 3708kb

input:

10000
13 1 1 13 1
2 1 1 2 1
43 1 1 43 1
5 1 1 5 1
19 1 1 19 1
20 1 1 20 1
15 1 1 15 1
2 1 1 2 1
68 1 1 68 1
9 1 1 9 1
6 1 1 6 1
40 1 1 40 1
6 1 1 6 1
40 1 1 40 1
12 1 1 12 1
21 1 1 21 1
38 1 1 38 1
26 1 1 26 1
1 1 1 1 1
18 1 1 18 1
59 1 1 59 1
16 1 1 16 1
12 1 1 12 1
2 1 1 2 1
12 1 1 12 1
1 1 1 1 1
...

output:

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

result:

ok Correct (10000 test cases)

Test #8:

score: 3
Accepted
time: 51ms
memory: 3628kb

input:

50000
2 1 1 2 1
3 1 1 3 1
5 1 1 5 1
1 1 1 1 1
5 1 1 5 1
2 1 1 2 1
2 1 1 2 1
2 1 1 2 1
2 1 1 2 1
6 1 1 6 1
4 1 1 4 1
3 1 1 3 1
4 1 1 4 1
1 1 1 1 1
2 1 1 2 1
2 1 1 2 1
3 1 1 3 1
3 1 1 3 1
2 1 1 2 1
10 1 1 10 1
1 1 1 1 1
1 1 1 1 1
6 1 1 6 1
1 1 1 1 1
6 1 1 6 1
1 1 1 1 1
5 1 1 5 1
14 1 1 14 1
1 1 1 1 1
...

output:

YES
1 2 
2 1 
2 1 YES
1 2 3 
3 2 1 
3 2 1 YES
1 2 3 4 5 
5 4 3 2 1 
5 4 3 2 1 YES
1 
1 
1 
YES
1 2 3 4 5 
5 4 3 2 1 
5 4 3 2 1 YES
1 2 
2 1 
2 1 YES
1 2 
2 1 
2 1 YES
1 2 
2 1 
2 1 YES
1 2 
2 1 
2 1 YES
1 2 3 4 5 6 
6 5 4 3 2 1 
6 5 4 3 2 1 YES
1 2 3 4 
4 3 2 1 
4 3 2 1 YES
1 2 3 
3 2 1 
3 2 1 YES
1...

result:

ok Correct (50000 test cases)

Subtask #2:

score: 0
Wrong Answer

Test #9:

score: 0
Wrong Answer
time: 17ms
memory: 3632kb

input:

40011
1 1 1 1 1
2 1 1 1 1
2 1 1 2 1
2 1 2 2 1
2 2 2 2 1
3 1 1 1 1
3 1 1 2 1
3 1 1 3 1
3 1 2 2 1
3 1 2 3 1
3 1 3 3 1
3 2 2 2 1
3 2 2 3 1
3 2 3 3 1
3 3 3 3 1
4 1 1 1 1
4 1 1 2 1
4 1 1 3 1
4 1 1 4 1
4 1 2 2 1
4 1 2 3 1
4 1 2 4 1
4 1 3 3 1
4 1 3 4 1
4 1 4 4 1
4 2 2 2 1
4 2 2 3 1
4 2 2 4 1
4 2 3 3 1
4 2 ...

output:

YES
1 
1 
1 
NO
YES
1 2 
2 1 
2 1 NO
NO
NO
NO
YES
1 2 3 
3 2 1 
3 2 1 YES
1 2 3 
3 2 1 
2 3 1 NO
NO
YES
1 2 3 
3 2 1 
2 3 1 NO
NO
NO
NO
NO
NO
YES
1 2 3 4 
4 3 2 1 
4 3 2 1 YES
1 2 3 4 
4 3 2 1 
3 4 1 2 YES
1 2 3 4 
4 3 2 1 
3 4 2 1 NO
NO
NO
NO
YES
1 2 3 4 
4 3 2 1 
3 4 1 2 YES
1 2 3 4 
4 3 2 1 
3 4 ...

result:

wrong answer Jury found the answer but participant didn't (test case 5)

Subtask #3:

score: 0
Wrong Answer

Dependency #1:

100%
Accepted

Test #10:

score: 0
Wrong Answer
time: 2ms
memory: 3560kb

input:

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

output:

NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
...

result:

wrong answer Jury found the answer but participant didn't (test case 9)

Subtask #4:

score: 17
Accepted

Dependency #1:

100%
Accepted

Test #34:

score: 17
Accepted
time: 14ms
memory: 3580kb

input:

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

output:

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

result:

ok Correct (7545 test cases)

Test #35:

score: 17
Accepted
time: 0ms
memory: 3556kb

input:

1
200000 1 320 613 1

output:

NO

result:

ok Correct (1 test case)

Test #36:

score: 17
Accepted
time: 0ms
memory: 3616kb

input:

1
200000 1 37 328 1

output:

NO

result:

ok Correct (1 test case)

Test #37:

score: 17
Accepted
time: 0ms
memory: 3708kb

input:

1
200000 1 119733 157102 1

output:

NO

result:

ok Correct (1 test case)

Test #38:

score: 17
Accepted
time: 23ms
memory: 3648kb

input:

1
199920 1 392 510 1

output:

YES
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...

result:

ok Correct (1 test case)

Test #39:

score: 17
Accepted
time: 0ms
memory: 3708kb

input:

1
200000 1 201 860 1

output:

NO

result:

ok Correct (1 test case)

Test #40:

score: 17
Accepted
time: 0ms
memory: 3580kb

input:

1
200000 1 91 436 1

output:

NO

result:

ok Correct (1 test case)

Test #41:

score: 17
Accepted
time: 0ms
memory: 3636kb

input:

1
200000 1 82406 192973 1

output:

NO

result:

ok Correct (1 test case)

Test #42:

score: 17
Accepted
time: 27ms
memory: 3584kb

input:

1
199870 1 253 790 1

output:

YES
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...

result:

ok Correct (1 test case)

Test #43:

score: 17
Accepted
time: 19ms
memory: 3620kb

input:

2
171916 1 177 82364 1
28044 1 123 228 1

output:

YES
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...

result:

ok Correct (2 test cases)

Test #44:

score: 17
Accepted
time: 1ms
memory: 3580kb

input:

2
103116 1 240 317 1
96884 1 20 1362 1

output:

NO
NO

result:

ok Correct (2 test cases)

Test #45:

score: 17
Accepted
time: 25ms
memory: 3568kb

input:

2
23087 1 6 2290 1
176913 1 161 67795 1

output:

NO
YES
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...

result:

ok Correct (2 test cases)

Test #46:

score: 17
Accepted
time: 23ms
memory: 3644kb

input:

2
143057 1 302 474 1
56943 1 23 28465 1

output:

YES
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...

result:

ok Correct (2 test cases)

Test #47:

score: 17
Accepted
time: 11ms
memory: 3560kb

input:

2
63028 1 16 184 1
136972 1 321 427 1

output:

NO
YES
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...

result:

ok Correct (2 test cases)

Test #48:

score: 17
Accepted
time: 5ms
memory: 3652kb

input:

5
24325 1 20928 21374 1
33507 1 73 459 1
91848 1 195 471 1
16722 1 14075 15313 1
33554 1 111 177 1

output:

NO
YES
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...

result:

ok Correct (5 test cases)

Test #49:

score: 17
Accepted
time: 5ms
memory: 3560kb

input:

5
86417 1 8 2042 1
570 1 1 570 1
32037 1 59 543 1
51708 1 51567 51694 1
29260 1 133 220 1

output:

NO
YES
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...

result:

ok Correct (5 test cases)

Test #50:

score: 17
Accepted
time: 22ms
memory: 3620kb

input:

5
2977 1 53 241 1
3400 1 17 200 1
8955 1 84 106 1
110257 1 133 829 1
74252 1 38 1954 1

output:

YES
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...

result:

ok Correct (5 test cases)

Test #51:

score: 17
Accepted
time: 20ms
memory: 3648kb

input:

20
1300 1 1 23 1
2405 1 37 65 1
22960 1 40 574 1
15455 1 51 61 1
24568 1 11526 12902 1
322 1 12 25 1
4398 1 35 124 1
8257 1 14 28 1
10266 1 58 177 1
45942 1 93 494 1
1262 1 11 80 1
11310 1 87 130 1
12392 1 38 130 1
2809 1 6 468 1
2721 1 1282 2696 1
7236 1 27 268 1
5796 1 23 252 1
19372 1 14 16195 1
...

output:

NO
YES
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...

result:

ok Correct (20 test cases)

Test #52:

score: 17
Accepted
time: 5ms
memory: 3648kb

input:

20
16303 1 37 322 1
4345 1 1949 3767 1
5808 1 11 528 1
5251 1 17 53 1
28284 1 44 404 1
35999 1 25775 29585 1
10283 1 7021 9568 1
5168 1 68 76 1
6800 1 12 344 1
5358 1 38 141 1
1027 1 12 35 1
47 1 3 15 1
11249 1 11 372 1
579 1 10 15 1
8741 1 62 6752 1
20511 1 22 711 1
8031 1 32 251 1
6585 1 2 1161 1
...

output:

NO
NO
YES
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 10...

result:

ok Correct (20 test cases)

Test #53:

score: 17
Accepted
time: 15ms
memory: 3560kb

input:

100
1273 1 31 34 1
1503 1 10 151 1
2935 1 54 652 1
4872 1 28 174 1
2328 1 8 77 1
2048 1 20 41 1
4128 1 45 1456 1
2855 1 3 1169 1
6624 1 41 77 1
2447 1 1 2447 1
2266 1 21 31 1
1875 1 25 67 1
2960 1 17 174 1
2432 1 6 1932 1
8 1 2 6 1
516 1 9 11 1
127 1 7 18 1
5831 1 17 343 1
2060 1 1 27 1
1074 1 28 23...

output:

NO
YES
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...

result:

ok Correct (100 test cases)

Test #54:

score: 17
Accepted
time: 11ms
memory: 3584kb

input:

1000
309 1 93 217 1
311 1 9 34 1
144 1 10 15 1
131 1 9 9 1
308 1 11 28 1
77 1 5 15 1
42 1 6 7 1
180 1 6 8 1
86 1 40 64 1
100 1 3 3 1
210 1 105 107 1
256 1 12 15 1
123 1 4 31 1
210 1 14 15 1
359 1 11 15 1
30 1 5 7 1
140 1 4 35 1
74 1 41 67 1
292 1 15 19 1
231 1 11 21 1
222 1 3 74 1
22 1 2 21 1
157 1 ...

output:

YES
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...

result:

ok Correct (1000 test cases)

Test #55:

score: 17
Accepted
time: 14ms
memory: 3584kb

input:

10000
12 1 3 4 1
2 1 1 1 1
43 1 2 11 1
5 1 3 3 1
19 1 3 4 1
20 1 6 14 1
15 1 2 6 1
2 1 2 2 1
68 1 7 10 1
9 1 1 6 1
6 1 1 4 1
40 1 2 2 1
6 1 2 2 1
40 1 3 13 1
12 1 2 5 1
21 1 2 8 1
38 1 1 38 1
26 1 1 26 1
1 1 1 1 1
18 1 1 14 1
59 1 17 56 1
16 1 1 4 1
12 1 9 9 1
2 1 1 1 1
12 1 2 6 1
1 1 1 1 1
2 1 1 1 ...

output:

YES
1 2 3 4 5 6 7 8 9 10 11 12 
12 11 10 9 8 7 6 5 4 3 2 1 
10 11 12 7 8 9 4 5 6 1 2 3 NO
NO
YES
1 2 3 4 5 
5 4 3 2 1 
3 4 5 2 1 NO
YES
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 
20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 
15 16 17 18 19 20 13 14 12 11 10 9 8 7 6 5 4 3 2 1 NO
NO
YES...

result:

ok Correct (10000 test cases)

Test #56:

score: 17
Accepted
time: 16ms
memory: 3560kb

input:

20000
8 1 2 4 1
5 1 1 2 1
1 1 1 1 1
3 1 1 3 1
15 1 3 5 1
16 1 4 4 1
6 1 3 5 1
1 1 1 1 1
27 1 3 5 1
24 1 4 7 1
5 1 2 3 1
3 1 1 2 1
26 1 2 12 1
2 1 1 2 1
12 1 3 4 1
3 1 1 2 1
5 1 2 3 1
9 1 3 3 1
22 1 2 10 1
14 1 2 7 1
2 1 1 2 1
8 1 2 4 1
1 1 1 1 1
5 1 2 2 1
15 1 1 3 1
15 1 3 8 1
16 1 4 4 1
21 1 3 7 1
...

output:

YES
1 2 3 4 5 6 7 8 
8 7 6 5 4 3 2 1 
7 8 5 6 3 4 1 2 NO
YES
1 
1 
1 
YES
1 2 3 
3 2 1 
3 2 1 YES
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 
13 14 15 10 11 12 7 8 9 4 5 6 1 2 3 YES
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 
16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 
13 14 15...

result:

ok Correct (20000 test cases)

Test #57:

score: 17
Accepted
time: 35ms
memory: 3708kb

input:

50000
2 1 1 2 1
3 1 1 3 1
5 1 1 2 1
1 1 1 1 1
5 1 2 2 1
2 1 1 2 1
2 1 1 2 1
2 1 1 1 1
2 1 1 1 1
6 1 1 5 1
4 1 1 4 1
3 1 1 3 1
4 1 2 2 1
1 1 1 1 1
2 1 1 2 1
2 1 1 2 1
3 1 1 3 1
3 1 1 3 1
2 1 1 2 1
10 1 1 10 1
1 1 1 1 1
1 1 1 1 1
6 1 1 1 1
1 1 1 1 1
6 1 2 4 1
1 1 1 1 1
5 1 2 2 1
14 1 2 8 1
1 1 1 1 1
6...

output:

YES
1 2 
2 1 
2 1 YES
1 2 3 
3 2 1 
3 2 1 NO
YES
1 
1 
1 
NO
YES
1 2 
2 1 
2 1 YES
1 2 
2 1 
2 1 NO
NO
NO
YES
1 2 3 4 
4 3 2 1 
4 3 2 1 YES
1 2 3 
3 2 1 
3 2 1 YES
1 2 3 4 
4 3 2 1 
3 4 1 2 YES
1 
1 
1 
YES
1 2 
2 1 
2 1 YES
1 2 
2 1 
2 1 YES
1 2 3 
3 2 1 
3 2 1 YES
1 2 3 
3 2 1 
3 2 1 YES
1 2 
2 1 ...

result:

ok Correct (50000 test cases)

Subtask #5:

score: 0
Wrong Answer

Test #58:

score: 0
Wrong Answer
time: 2ms
memory: 3720kb

input:

11753
20 10 12 19 0
21 3 4 18 0
21 5 12 14 0
7 1 1 3 0
16 9 10 13 0
13 3 4 9 0
21 11 13 14 0
16 15 16 16 0
20 10 10 13 0
19 3 9 13 0
18 1 17 18 0
15 2 4 4 0
14 2 4 5 0
19 3 9 16 0
16 10 12 15 0
18 2 7 17 0
18 1 1 12 0
14 1 1 1 0
9 1 2 5 0
17 8 15 15 0
18 2 2 14 0
19 9 14 17 0
20 2 10 16 0
20 8 9 17 ...

output:

NO
YES
NO
NO
NO
YES
NO
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO
NO
NO
NO
YES
NO
YES
NO
YES
NO
NO
NO
NO
NO
YES
YES
YES
NO
YES
NO
NO
NO
NO
YES
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
YES
NO
NO
NO
YES
NO
NO
NO
...

result:

wrong answer Wrong answer (test case 3)

Subtask #6:

score: 0
Skipped

Dependency #2:

0%