QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#51338#4930. LCS of Permutationslarryzhong22 49ms3752kbC++171.7kb2022-10-02 01:10:342022-10-02 01:10:36

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 49ms
memory: 3656kb

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:

wrong answer LCS of p and q is not a (test case 1)

Subtask #2:

score: 0
Wrong Answer

Test #9:

score: 0
Wrong Answer
time: 41ms
memory: 3752kb

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 
1 2 
1 2 
NO
YES
1 2 
1 2 
1 2 
NO
NO
YES
1 2 3 
1 2 3 
1 2 3 
YES
1 3 2 
1 3 2 
1 2 3 
NO
NO
YES
1 3 2 
1 3 2 
1 3 2 
YES
1 2 3 
1 2 3 
1 2 3 
NO
YES
1 2 3 
1 2 3 
1 2 3 
NO
NO
NO
YES
1 2 3 4 
1 2 3 4 
1 2 3 4 
YES
1 3 2 4 
1 3 2 4 
1 2 3 4 
YES
1 3 4 2 
1 3 4 2 
1 2 3 4 
N...

result:

wrong answer LCS of p and q is not a (test case 3)

Subtask #3:

score: 0
Skipped

Dependency #1:

0%

Subtask #4:

score: 0
Skipped

Dependency #1:

0%

Subtask #5:

score: 22
Accepted

Test #58:

score: 22
Accepted
time: 6ms
memory: 3580kb

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
YES
NO
YES
YES
YES
NO
YES
YES
NO
YES
YES
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO
YES
NO
NO
YES
YES
YES
YES
YES
NO
NO
NO
NO
NO
YES
YES
YES
NO
YES
YES
NO
NO
NO
YES
NO
YES
NO
NO
YES
NO
YES
YES
YES
NO
NO
NO
YES
NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO
YES
YES
NO
YES
NO
NO
NO
NO
YES
NO
YES
NO
YES
NO
NO
N...

result:

ok Correct (11753 test cases)

Test #59:

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

input:

21
6560 110 110 6560 0
904 553 553 904 0
1718 5 5 1718 0
639 2 2 639 0
23718 12352 12352 23718 0
10182 9668 9668 10182 0
4957 1334 1334 4957 0
1074 2 2 1074 0
4359 2201 2201 4359 0
7964 1 1 7964 0
16234 16234 16234 16234 0
617 1 1 617 0
1895 1494 1494 1895 0
16803 16803 16803 16803 0
3958 1 1 3958 0...

output:

YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES

result:

ok Correct (21 test cases)

Test #60:

score: 0
Accepted
time: 0ms
memory: 3576kb

input:

1001
399 3 3 399 0
98 95 95 98 0
209 1 1 209 0
32 26 26 32 0
1 1 1 1 0
173 57 57 173 0
9 1 1 9 0
77 11 11 77 0
120 36 37 120 0
246 1 1 246 0
138 138 138 138 0
66 1 1 66 0
76 5 5 76 0
253 233 233 253 0
65 1 1 65 0
74 5 5 74 0
55 1 1 55 0
871 1 1 871 0
106 106 106 106 0
6 5 5 6 0
6 5 5 6 0
211 100 146...

output:

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

result:

ok Correct (1001 test cases)

Test #61:

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

input:

21
6560 1 30 182 0
904 1 16 57 0
1718 1 11 36 0
639 1 2 295 0
23718 1 111 11309 0
10182 1 27 377 0
4957 1 22 93 0
1072 1 8 134 0
4359 1 13 140 0
7964 1 44 182 0
16234 1 31 524 0
617 1 14 45 0
1895 1 35 54 0
16803 1 59 129 0
3958 1 17 221 0
14490 1 35 414 0
4841 1 58 82 0
21837 1 17963 19658 0
26093 ...

output:

NO
YES
NO
NO
YES
NO
NO
YES
NO
YES
YES
YES
NO
NO
NO
YES
NO
NO
YES
NO
NO

result:

ok Correct (21 test cases)

Test #62:

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

input:

1001
399 1 12 33 0
98 1 6 9 0
209 1 117 184 0
32 1 3 9 0
1 1 1 1 0
173 1 12 13 0
9 1 2 3 0
75 1 3 25 0
120 1 5 23 0
246 1 5 17 0
138 1 6 22 0
66 1 4 4 0
76 1 4 24 0
253 1 6 43 0
65 1 1 23 0
74 1 3 17 0
55 1 5 55 0
871 1 109 800 0
106 1 10 10 0
6 1 1 5 0
6 1 1 5 0
207 1 9 23 0
274 1 217 219 0
34 1 5 ...

output:

NO
NO
NO
NO
YES
NO
NO
YES
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
YES
NO
YES
YES
NO
YES
YES
NO
YES
NO
NO
YES
NO
NO
NO
YES
YES
YES
NO
NO
NO
NO
YES
NO
YES
YES
YES
YES
NO
YES
YES
YES
NO
YES
YES
YES
YES
YES
NO
YES
NO
YES
YES
YES
NO
YES
NO
YES
YES
YES
YES
NO
NO
NO
NO
YES
YES
NO
NO
YES
YES
NO
YES
NO
NO
Y...

result:

ok Correct (1001 test cases)

Test #63:

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

input:

1
530 313 320 377 0

output:

YES

result:

ok Correct (1 test case)

Test #64:

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

input:

1
200000 2 2 199999 0

output:

YES

result:

ok Correct (1 test case)

Test #65:

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

input:

1
200000 39866 96910 119733 0

output:

YES

result:

ok Correct (1 test case)

Test #66:

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

input:

1
192962 36 40 134 0

output:

NO

result:

ok Correct (1 test case)

Test #67:

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

input:

1
888 201 225 833 0

output:

YES

result:

ok Correct (1 test case)

Test #68:

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

input:

1
200000 2 2 199999 0

output:

YES

result:

ok Correct (1 test case)

Test #69:

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

input:

1
200000 75873 82406 104420 0

output:

YES

result:

ok Correct (1 test case)

Test #70:

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

input:

1
84478 19 57 78 0

output:

NO

result:

ok Correct (1 test case)

Test #71:

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

input:

2
97 40 41 43 0
8427 8 9 117 0

output:

YES
NO

result:

ok Correct (2 test cases)

Test #72:

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

input:

2
2515 41 240 1573 0
300 2 161 290 0

output:

YES
NO

result:

ok Correct (2 test cases)

Test #73:

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

input:

2
187 6 123 182 0
176913 59051 73817 134152 0

output:

NO
YES

result:

ok Correct (2 test cases)

Test #74:

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

input:

2
75208 28 34 79 0
4802 8 20 30 0

output:

YES
NO

result:

ok Correct (2 test cases)

Test #75:

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

input:

2
63028 2 2 63027 0
840 11 80 163 0

output:

YES
YES

result:

ok Correct (2 test cases)

Test #76:

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

input:

5
24325 4762 15785 20928 0
22050 14 15 105 0
91848 2128 81207 87288 0
16722 20 1395 10601 0
28603 20 26 55 0

output:

NO
YES
NO
YES
NO

result:

ok Correct (5 test cases)

Test #77:

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

input:

5
714 8 121 655 0
570 1 10 235 0
32040 925 5835 8088 0
15705 4 26 151 0
23038 8 48 60 0

output:

NO
YES
YES
NO
YES

result:

ok Correct (5 test cases)

Test #78:

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

input:

5
69 1 43 67 0
3411 2 2 3410 0
715 4 6 30 0
1532 72 222 227 0
2476 30 169 244 0

output:

NO
YES
YES
YES
YES

result:

ok Correct (5 test cases)

Test #79:

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

input:

20
76 14 17 23 0
1795 5 12 30 0
302 1 17 18 0
572 27 123 343 0
350 37 70 126 0
172 1 5 34 0
1223 5 5 49 0
317 26 42 236 0
10315 2064 5090 6560 0
134 11 31 118 0
43 29 31 33 0
87 10 13 51 0
1549 8 17 1284 0
291 2 11 13 0
100 23 27 32 0
3834 3 6 213 0
830 7 24 427 0
29 17 24 27 0
29 18 21 22 0
105 1 5...

output:

YES
YES
YES
YES
YES
NO
YES
YES
YES
NO
YES
YES
YES
NO
YES
YES
YES
NO
YES
NO

result:

ok Correct (20 test cases)

Test #80:

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

input:

20
161 4 37 101 0
869 5 42 115 0
109 17 49 53 0
37 4 35 35 0
28284 7178 17469 17850 0
19084 10 18 106 0
1622 5 18 18 0
3269 2 15 109 0
6800 2 2 6799 0
1348 4 30 1327 0
42 21 24 26 0
27 3 3 3 0
2588 7 9 41 0
214 2 6 18 0
5950 7 25 34 0
11757 14 28 30 0
8031 2 2 8030 0
514 2 15 17 0
159 1 10 16 0
82 9...

output:

YES
YES
YES
NO
YES
NO
NO
YES
YES
NO
YES
YES
NO
YES
YES
YES
YES
NO
YES
YES

result:

ok Correct (20 test cases)

Test #81:

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

input:

100
55 13 23 34 0
110 1 9 12 0
1467 2 32 1114 0
87 47 56 56 0
1260 7 10 18 0
1326 7 10 19 0
67 20 26 61 0
317 9 35 67 0
6624 2 2 6623 0
38 4 13 16 0
56 23 39 40 0
1875 2 2 1874 0
117 1 10 12 0
21 2 7 16 0
8 1 1 8 0
154 1 7 22 0
127 2 2 126 0
4840 8 11 55 0
2060 1420 1891 1917 0
358 3 27 64 0
406 5 9...

output:

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

result:

ok Correct (100 test cases)

Test #82:

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

input:

1000
309 6 93 194 0
255 4 7 9 0
144 2 2 143 0
114 2 5 11 0
8 4 6 6 0
77 8 24 44 0
45 1 3 15 0
180 2 2 179 0
14 1 4 6 0
100 2 2 99 0
93 1 2 44 0
176 1 8 22 0
123 31 56 108 0
135 1 5 26 0
8 3 6 7 0
27 3 3 3 0
126 1 3 42 0
14 5 5 10 0
14 2 10 13 0
210 1 7 30 0
224 6 32 214 0
3 2 2 3 0
121 2 3 20 0
63 3...

output:

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

result:

ok Correct (1000 test cases)

Test #83:

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

input:

10000
7 1 1 2 0
2 1 1 2 0
14 1 3 11 0
2 1 2 2 0
9 2 2 8 0
7 1 1 2 0
7 1 2 6 0
2 1 1 2 0
34 1 2 27 0
4 2 2 3 0
6 1 1 3 0
22 3 3 3 0
6 1 1 3 0
8 3 5 6 0
6 1 2 2 0
15 1 2 7 0
38 15 21 26 0
13 2 3 7 0
1 1 1 1 0
9 1 3 3 0
59 1 2 47 0
16 1 2 10 0
12 2 2 11 0
2 1 1 2 0
4 2 3 3 0
1 1 1 1 0
1 1 1 1 0
14 2 2 ...

output:

NO
YES
YES
NO
YES
NO
YES
YES
YES
YES
NO
YES
NO
YES
NO
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
NO
YES
YES
YES
NO
YES
NO
YES
YES
YES
NO
NO
YES
NO
YES
YES
YES
YES
NO
YES
YES
NO
YES
YES
YES
YES
NO
NO
YES
YES
YES
NO
NO
NO
YES
NO
NO
YES
YES
YES
YES
NO
NO
YES
NO
YES
NO
YES
YES
NO
YES
YES
NO
YES
Y...

result:

ok Correct (10000 test cases)

Test #84:

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

input:

20000
9 1 2 3 0
5 1 1 5 0
1 1 1 1 0
3 2 3 3 0
15 1 1 15 0
8 1 2 5 0
5 1 2 2 0
1 1 1 1 0
9 1 2 4 0
20 2 3 3 0
3 1 1 3 0
2 1 1 2 0
8 3 5 8 0
2 1 1 2 0
6 1 1 2 0
1 1 1 1 0
5 1 2 5 0
9 1 3 4 0
22 1 4 19 0
12 1 2 7 0
2 1 1 2 0
2 1 1 2 0
1 1 1 1 0
5 1 1 3 0
15 3 10 14 0
5 1 1 2 0
11 1 2 5 0
21 1 2 18 0
2 ...

output:

NO
YES
YES
NO
YES
YES
NO
YES
NO
NO
YES
YES
NO
YES
NO
YES
NO
YES
YES
YES
YES
YES
YES
NO
NO
NO
NO
YES
NO
YES
YES
YES
YES
NO
YES
YES
NO
NO
YES
YES
YES
YES
NO
NO
YES
YES
NO
YES
YES
YES
YES
NO
YES
YES
NO
NO
YES
YES
NO
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
NO
NO
YES
YES
NO
NO
YES
YES
YES
YES
NO
YES
Y...

result:

ok Correct (20000 test cases)

Test #85:

score: 0
Accepted
time: 12ms
memory: 3652kb

input:

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

output:

YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
NO
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
NO
YES
YES
YE...

result:

ok Correct (50000 test cases)

Subtask #6:

score: 0
Skipped

Dependency #2:

0%