QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#524074#4930. LCS of PermutationsModyKachef13 37ms3716kbC++23656b2024-08-19 09:59:352024-08-19 09:59:35

Judging History

你现在查看的是最新测评结果

  • [2024-08-19 09:59:35]
  • 评测
  • 测评结果:13
  • 用时:37ms
  • 内存:3716kb
  • [2024-08-19 09:59:35]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define int long long 

void doWork(){
   int n , a , b , c , o;
   cin >> n >> a >> b >> c >> o; 
	if (a != b) {cout << "NO"; return; }
	cout << "YES\n";
	for (int i = 1 ; i <= n ; i++){cout << i << ' ';} cout << '\n';
	for (int i = 1 ; i < a ; i++) cout << i << ' '; for (int i = n ; i >= a ; i--) cout << i << ' '; cout <<'\n';
	for (int i = 1 ; i < a ; i++) cout << i << ' '; for (int i = n ; i >= a ; i--) cout << i << ' '; cout <<'\n';
}

signed main(){
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int t; cin >> t;
    while(t--){
        doWork(); cout << '\n';
    }
}

詳細信息

Subtask #1:

score: 3
Accepted

Test #1:

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

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: 21ms
memory: 3704kb

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: 18ms
memory: 3636kb

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: 14ms
memory: 3628kb

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: 17ms
memory: 3620kb

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: 20ms
memory: 3552kb

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: 18ms
memory: 3628kb

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 ...

result:

ok Correct (10000 test cases)

Test #8:

score: 3
Accepted
time: 28ms
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 ...

result:

ok Correct (50000 test cases)

Subtask #2:

score: 0
Wrong Answer

Test #9:

score: 0
Wrong Answer
time: 15ms
memory: 3716kb

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 

YES
1 2 
2 1 
2 1 

YES
1 2 
2 1 
2 1 

NO
YES
1 2 
1 2 
1 2 

YES
1 2 3 
3 2 1 
3 2 1 

YES
1 2 3 
3 2 1 
3 2 1 

YES
1 2 3 
3 2 1 
3 2 1 

NO
NO
NO
YES
1 2 3 
1 3 2 
1 3 2 

YES
1 2 3 
1 3 2 
1 3 2 

NO
YES
1 2 3 
1 2 3 
1 2 3 

YES
1 2 3 4 
4 3 2 1 
4 3 2 1 

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

result:

wrong answer LCS of q and r is not c (test case 2)

Subtask #3:

score: 10
Accepted

Dependency #1:

100%
Accepted

Test #10:

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

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
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 
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 33 32 31 30 
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 33 32 31 30 ...

result:

ok Correct (7545 test cases)

Test #11:

score: 10
Accepted
time: 21ms
memory: 3624kb

input:

1
200000 46236 46236 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 #12:

score: 10
Accepted
time: 17ms
memory: 3564kb

input:

1
200000 199998 199998 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 #13:

score: 10
Accepted
time: 0ms
memory: 3644kb

input:

1
200000 73211 119733 200000 1

output:

NO

result:

ok Correct (1 test case)

Test #14:

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

input:

1
200000 200000 200000 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 #15:

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

input:

1
200000 17422 17422 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 #16:

score: 10
Accepted
time: 22ms
memory: 3612kb

input:

1
200000 199997 199997 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 #17:

score: 10
Accepted
time: 0ms
memory: 3700kb

input:

1
200000 24843 82406 200000 1

output:

NO

result:

ok Correct (1 test case)

Test #18:

score: 10
Accepted
time: 22ms
memory: 3660kb

input:

1
200000 200000 200000 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 #19:

score: 10
Accepted
time: 18ms
memory: 3632kb

input:

2
171916 1 1 171916 1
28084 1140 25963 28084 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 #20:

score: 10
Accepted
time: 11ms
memory: 3688kb

input:

2
103116 45915 45915 103116 1
96884 64304 83444 96884 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 #21:

score: 10
Accepted
time: 17ms
memory: 3688kb

input:

2
23087 20700 20700 23087 1
176913 1 1 176913 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 #22:

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

input:

2
143057 1 1 143057 1
56943 56943 56943 56943 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 #23:

score: 10
Accepted
time: 21ms
memory: 3616kb

input:

2
63028 63026 63026 63028 1
136972 80745 80745 136972 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 #24:

score: 10
Accepted
time: 15ms
memory: 3640kb

input:

5
24325 12027 20928 24325 1
33551 33551 33551 33551 1
91848 1 1 91848 1
16722 2 2 16722 1
33554 17593 32887 33554 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 #25:

score: 10
Accepted
time: 18ms
memory: 3576kb

input:

5
86417 5681 5681 86417 1
570 3 3 570 1
32040 10134 10134 32040 1
51708 51704 51704 51708 1
29265 12195 16608 29265 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 #26:

score: 10
Accepted
time: 18ms
memory: 3584kb

input:

5
2977 1 1 2977 1
3411 3411 3411 3411 1
8955 8955 8955 8955 1
110370 110370 110370 110370 1
74287 74283 74283 74287 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 #27:

score: 10
Accepted
time: 20ms
memory: 3612kb

input:

20
1300 883 883 1300 1
2409 2409 2409 2409 1
22980 22980 22980 22980 1
15455 4 4 15455 1
24568 24568 24568 24568 1
322 322 322 322 1
4398 1 1 4398 1
8257 1956 1956 8257 1
10315 1659 1659 10315 1
45979 1 1 45979 1
1262 285 285 1262 1
11356 1397 1397 11356 1
12392 7768 7768 12392 1
2809 2809 2809 2809...

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 #28:

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

input:

20
16303 11310 11310 16303 1
4345 1 1 4345 1
5817 1657 4906 5817 1
5251 5251 5251 5251 1
28284 12365 14700 28284 1
35999 35999 35999 35999 1
10283 8857 8857 10283 1
5202 2591 2591 5202 1
6800 1 1 6800 1
5395 3076 3271 5395 1
1027 57 57 1027 1
47 47 47 47 1
11249 11247 11247 11249 1
579 441 441 579 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 #29:

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

input:

100
1273 1248 1248 1273 1
1503 1 1 1503 1
2935 1 1 2935 1
4875 4875 4875 4875 1
2328 1 1 2328 1
2048 1764 1764 2048 1
4128 4128 4128 4128 1
2855 593 593 2855 1
6624 1904 1904 6624 1
2447 2415 2415 2447 1
2266 1879 1998 2266 1
1875 1837 1837 1875 1
2960 2956 2956 2960 1
2432 1661 1661 2432 1
8 4 4 8 ...

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 #30:

score: 10
Accepted
time: 14ms
memory: 3644kb

input:

1000
309 32 93 309 1
311 4 4 311 1
144 1 1 144 1
131 131 131 131 1
317 317 317 317 1
77 77 77 77 1
45 1 1 45 1
180 180 180 180 1
86 1 1 86 1
100 15 15 100 1
210 91 91 210 1
256 73 73 256 1
123 64 64 123 1
220 216 216 220 1
359 359 359 359 1
30 29 29 30 1
142 142 142 142 1
74 3 3 74 1
292 292 292 292...

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 (1000 test cases)

Test #31:

score: 10
Accepted
time: 11ms
memory: 3708kb

input:

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

output:

YES
1 2 3 4 5 6 7 8 9 10 11 12 13 
1 2 3 4 5 6 7 8 9 10 11 12 13 
1 2 3 4 5 6 7 8 9 10 11 12 13 

YES
1 2 
1 2 
1 2 

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 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 ...

result:

ok Correct (10000 test cases)

Test #32:

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

input:

20000
9 9 9 9 1
5 2 2 5 1
1 1 1 1 1
3 1 1 3 1
15 1 1 15 1
16 13 13 16 1
6 3 3 6 1
1 1 1 1 1
27 1 1 27 1
24 24 24 24 1
5 5 5 5 1
3 1 1 3 1
26 26 26 26 1
2 1 1 2 1
12 1 1 12 1
3 1 1 3 1
5 1 1 5 1
9 9 9 9 1
22 3 3 22 1
15 2 2 15 1
2 1 1 2 1
8 6 6 8 1
1 1 1 1 1
5 5 5 5 1
15 4 4 15 1
15 1 1 15 1
16 5 5 1...

output:

YES
1 2 3 4 5 6 7 8 9 
1 2 3 4 5 6 7 8 9 
1 2 3 4 5 6 7 8 9 

YES
1 2 3 4 5 
1 5 4 3 2 
1 5 4 3 2 

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 
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 

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

result:

ok Correct (20000 test cases)

Test #33:

score: 10
Accepted
time: 37ms
memory: 3624kb

input:

100000
1 1 1 1 1
2 2 2 2 1
1 1 1 1 1
1 1 1 1 1
7 7 7 7 1
3 1 1 3 1
2 2 2 2 1
3 1 1 3 1
2 1 1 2 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
3 1 1 3 1
1 1 1 1 1
1 1 1 1 1
2 2 2 2 1
1 1 1 1 1
4 1 1 4 1
2 1 1 2 1
2 1 1 2 1
1 1 1 1 1
1 1 1 1 1
3 2 2 3 1
1 1 1 1 1
2 2 2 2 1
4 4 4 4 1
1 1 1 1 1
3 2 2 3 1
1 1 1 1 1
1 1...

output:

YES
1 
1 
1 

YES
1 2 
1 2 
1 2 

YES
1 
1 
1 

YES
1 
1 
1 

YES
1 2 3 4 5 6 7 
1 2 3 4 5 6 7 
1 2 3 4 5 6 7 

YES
1 2 3 
3 2 1 
3 2 1 

YES
1 2 
1 2 
1 2 

YES
1 2 3 
3 2 1 
3 2 1 

YES
1 2 
2 1 
2 1 

YES
1 
1 
1 

YES
1 
1 
1 

YES
1 
1 
1 

YES
1 2 3 
3 2 1 
3 2 1 

YES
1 
1 
1 

YES
1 
1 
1 

...

result:

ok Correct (100000 test cases)

Subtask #4:

score: 0
Wrong Answer

Dependency #1:

100%
Accepted

Test #34:

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

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:

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

NO
NO
YES
1 2 3 4 5 6 7 8 9 
9 8 7 6 5 4...

result:

wrong answer LCS of q and r is not c (test case 1)

Subtask #5:

score: 0
Wrong Answer

Test #58:

score: 0
Wrong Answer
time: 6ms
memory: 3648kb

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
NO
NO
YES
1 2 3 4 5 6 7 
7 6 5 4 3 2 1 
7 6 5 4 3 2 1 

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

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

result:

wrong answer Wrong answer (test case 2)

Subtask #6:

score: 0
Skipped

Dependency #2:

0%