QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#414989#1817. AND PermutationPrinceton_TigersRE 56ms40812kbC++173.2kb2024-05-20 06:38:322024-05-20 06:38:33

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 6ms
memory: 36320kb

input:

6
0
1
4
5
2
6

output:

4
6
0
2
5
1

result:

ok OK!

Test #2:

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

input:

272
315
138
126
6
394
297
44
273
84
200
9
197
396
133
16
46
65
87
86
336
316
174
140
162
250
306
52
188
57
36
63
192
320
388
10
156
15
208
38
32
31
228
30
305
234
384
220
142
72
27
337
110
94
317
304
242
398
209
5
323
29
284
301
309
244
230
261
61
254
266
194
296
275
313
80
206
214
88
308
18
288
106...

output:

196
116
129
0
85
214
274
238
130
311
262
314
114
122
38
145
158
168
160
43
195
337
19
284
261
141
10
323
70
18
320
319
63
59
52
98
176
303
16
22
96
283
1
206
277
62
291
48
418
164
174
272
416
194
78
269
49
302
82
188
64
162
210
202
267
281
250
322
257
53
317
215
236
198
135
305
297
422
11
36
151
149...

result:

ok OK!

Test #3:

score: 0
Accepted
time: 56ms
memory: 40812kb

input:

5134
36416
73248
85220
2072
16524
36385
101507
91137
17604
22
640
70530
66850
107792
81952
163
84260
46246
45090
101411
18824
66360
116881
400
50338
109824
17508
122881
98691
99843
36481
1696
102658
27008
2566
4
32900
103171
1153
104706
69923
82280
19616
66849
17540
36870
8352
117777
82156
6785
6780...

output:

65953
33027
33560
103555
106274
74128
16676
7040
72482
72481
2080
3140
43137
2276
6657
72448
1667
65609
85196
4992
33796
62598
1826
19456
80384
16529
105344
1452
19492
2532
81960
98576
3713
99872
124304
67714
66848
19628
2336
9361
36560
38019
74496
59520
2112
84384
6400
4320
40707
74784
34562
66668
...

result:

ok OK!

Test #4:

score: 0
Accepted
time: 4ms
memory: 37460kb

input:

15
10
0
11
13
2
14
4
1
5
6
8
12
3
7
9

output:

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

result:

ok OK!

Test #5:

score: 0
Accepted
time: 37ms
memory: 38452kb

input:

3237
9776
12036
8229
2100
10676
17349
26144
2690
30256
3088
27328
31796
3344
54
3637
16908
17030
31749
8593
153
20020
2305
24980
17413
1155
16524
1068
16576
2881
1139
10416
1924
17284
1042
16969
1066
28084
24608
29220
25125
19744
26117
128
28724
4760
17792
27008
17696
4372
6784
19157
8577
405
19072
...

output:

18693
185
912
25216
16898
15408
2452
25876
2501
28676
277
195
25220
24065
24960
10449
10544
58
18980
20256
8641
16912
6689
6832
10804
11025
19409
2836
24756
27276
17925
26673
14384
27296
9652
27605
75
1168
1171
2200
12805
2104
16
2753
26692
14868
1589
10901
18465
24852
5152
19972
27144
9236
16412
85...

result:

ok OK!

Test #6:

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

input:

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

output:

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

result:

ok OK!

Test #7:

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

input:

286
304
63
445
257
143
170
407
68
55
44
256
53
176
310
4
436
356
33
6
442
160
38
314
273
296
420
299
173
64
408
0
401
169
423
40
284
135
187
358
397
301
70
260
393
190
174
36
428
65
183
421
21
390
58
28
73
288
434
403
104
10
405
443
168
46
43
171
47
398
311
185
279
413
15
277
23
19
20
42
261
278
139...

output:

143
384
66
190
304
277
104
443
392
403
33
394
271
137
48
11
155
256
49
5
287
9
133
174
151
27
148
274
447
39
32
46
278
88
1
163
312
324
153
50
146
441
56
54
257
273
8
19
446
264
26
426
121
389
419
438
17
13
44
407
437
42
68
279
401
404
276
400
113
136
326
168
98
432
170
424
428
427
405
186
169
308
2...

result:

ok OK!

Test #8:

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

input:

260
261
790
778
536
273
7
28
19
840
12
3
527
75
4
599
795
336
543
793
82
850
286
852
2
848
539
841
587
847
326
535
515
519
837
86
78
322
271
525
80
785
22
596
523
794
95
81
339
70
798
590
67
333
69
834
284
21
540
30
72
789
581
514
8
26
27
11
1024
594
770
257
348
279
861
331
73
600
264
277
577
6
345
...

output:

602
73
85
327
590
856
835
844
23
851
860
336
788
859
264
68
527
320
70
781
13
577
11
861
15
324
22
276
16
537
328
348
344
26
777
785
541
592
338
783
78
841
267
340
69
768
782
524
793
65
273
796
530
794
29
579
842
323
833
791
74
282
349
1
837
836
852
863
269
93
606
515
584
2
532
790
263
599
586
286
8...

result:

ok OK!

Test #9:

score: -100
Runtime Error

input:

128
240
194
178
243
2
131
163
32
112
225
153
129
97
82
25
158
140
144
134
66
69
65
98
24
13
26
192
157
160
3
49
211
196
6
133
14
33
5
12
139
99
176
28
179
83
138
11
150
19
155
224
137
208
15
4
154
113
143
147
135
18
81
34
149
73
136
23
76
209
30
197
146
27
17
80
48
227
145
168
152
68
0
50
1
51
29
20...

output:

15
21
77
12
144
4
20
155
143
30
34
0

result: