QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#415003#1817. AND PermutationPrinceton_TigersML 4323ms186628kbC++173.3kb2024-05-20 07:05:562024-05-20 07:05:57

详细

Test #1:

score: 100
Accepted
time: 4ms
memory: 37696kb

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: 37188kb

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
53
129
24
84
214
82
238
394
311
118
314
51
122
32
145
62
168
1
47
195
337
306
284
261
140
10
323
390
8
320
319
63
59
52
35
176
303
25
16
160
283
384
206
277
30
291
64
278
68
174
272
416
194
78
269
112
302
58
188
290
162
210
202
267
281
250
322
257
21
317
215
236
198
39
305
297
294
3
4
23
149
256...

result:

ok OK!

Test #3:

score: 0
Accepted
time: 43ms
memory: 40676kb

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:

69797
57474
529
104195
106274
396
8496
39298
6945
106113
1281
41988
10369
2723
35970
101632
38018
65609
85380
8576
36898
60545
9472
67616
72448
16608
72578
8064
11872
2532
82216
26880
26753
99842
123281
3073
68704
19692
2592
1697
3096
44177
528
35472
6658
83329
100352
5024
44305
34064
1297
4200
1568...

result:

ok OK!

Test #4:

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

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: 23ms
memory: 38256kb

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:

18501
16560
20112
832
22017
6200
2245
28693
2248
16644
57
195
8864
27265
8322
2480
15377
760
20000
28192
8641
9744
6177
10928
19028
11025
19409
3620
24756
25476
16972
26673
9264
29189
11444
27605
75
2820
2513
2448
8853
6384
16896
2433
27940
14353
4628
10901
27329
17684
5152
19012
23072
65
16593
8469...

result:

ok OK!

Test #6:

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

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

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
36
394
271
137
290
11
155
2
56
5
287
24
133
174
151
27
148
274
447
39
32
46
278
88
260
163
312
324
153
50
146
441
40
54
257
273
256
19
446
264
26
426
121
389
419
438
9
13
44
407
437
42
68
279
401
404
276
400
113
136
326
168
98
432
170
424
428
427
405
186
169
30...

result:

ok OK!

Test #8:

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

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: 0
Accepted
time: 0ms
memory: 36644kb

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
5
77
12
136
16
24
155
143
30
6
8
158
133
162
97
115
3
17
149
154
138
157
163
242
197
49
98
23
144
192
40
27
153
82
241
150
194
243
80
156
7
227
76
168
65
208
33
132
32
31
34
11
240
177
69
142
112
68
64
193
170
137
66
146
2
160
179
42
225
26
73
196
134
139
195
28
10
83
67
147
128
205
130
204
226
1...

result:

ok OK!

Test #10:

score: 0
Accepted
time: 8ms
memory: 37180kb

input:

24
2
12
28
5
26
3
24
10
8
7
22
17
1
6
16
20
19
0
18
11
4
9
25
27

output:

0
19
3
26
5
28
7
17
16
24
9
10
18
25
8
11
12
2
1
20
27
22
6
4

result:

ok OK!

Test #11:

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

input:

1572
2144
58
3077
672
2376
2112
3978
1879
1170
557
2817
851
3975
2346
1814
1294
24
2602
1610
3457
606
1875
2818
2629
864
2156
1350
178
30
674
1547
2668
2948
1864
2432
2178
1310
176
2317
658
1057
587
2152
256
2927
1069
1282
1682
440
2208
2096
2850
1213
3076
3599
2607
1574
849
657
1188
578
676
1161
11...

output:

1054
1605
554
1311
1590
776
53
2216
2925
1042
1038
3212
120
1621
2121
2688
2567
1157
2085
94
2337
2092
1097
272
2202
1923
2080
2892
3840
1117
2180
1299
1115
2182
109
1565
2657
1614
1698
2157
590
2436
903
8
1168
448
524
2413
2631
1887
1615
85
2882
393
336
1360
2313
3206
3342
2635
2060
1363
2822
865
3...

result:

ok OK!

Test #12:

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

input:

494
410
96
93
915
349
71
374
344
537
649
146
962
132
19
78
141
162
103
101
272
263
2
367
615
544
787
898
368
70
994
15
185
355
594
113
80
61
326
60
576
200
612
385
586
154
5
657
520
319
528
58
271
194
274
290
377
369
9
769
362
125
614
50
102
651
393
74
371
810
682
375
519
583
98
64
119
387
424
391
3...

output:

613
274
930
108
674
392
649
35
482
374
300
61
379
64
49
370
792
920
922
11
104
257
656
408
460
232
125
523
25
29
352
582
536
297
394
770
962
56
321
178
39
411
122
305
800
490
366
291
704
363
320
112
301
96
73
518
138
262
62
144
898
409
328
921
372
610
768
140
129
341
648
376
424
281
19
904
120
583
6...

result:

ok OK!

Test #13:

score: 0
Accepted
time: 2554ms
memory: 150836kb

input:

199969
8669248
1075841048
201328650
44042242
577154
1477480448
75844
406986886
1209534848
37758482
402981064
8462848
67126848
36160
35783200
268500996
25297024
203492360
138412736
1243643904
180232
570441730
272732160
67568128
52564512
570886432
34016
1225073920
536940936
1074372864
4556832
26850128...

output:

218629122
229444
73904
285217352
1619197960
84419600
181256
69226000
100810792
1677988132
1611158048
33816712
2392208
817889284
67121472
67117120
134316288
814744384
35800064
554704928
184553472
2102528
18104578
18882570
545309760
205542464
369360916
4327622
285753440
168825928
75497606
545259600
12...

result:

ok OK!

Test #14:

score: 0
Accepted
time: 4323ms
memory: 186628kb

input:

190281
53740576
202441232
536983640
1145053184
202703424
706479124
537213456
135726400
322181124
369160232
264208
16875750
536984090
604439104
254017728
538217476
672404500
12716036
1075089440
401830
310411820
1357398048
201721088
151389008
67162128
302098580
385933344
310487132
134481938
1144115456...

output:

805353992
17080608
21234470
537006098
539103508
85983432
8519974
310413868
675939848
671483412
138412068
709236232
1357906080
287346724
541215012
268435704
100821248
1049936
687932160
671189528
542267392
706090512
1882198048
310415404
20980320
219545888
139859464
1618494112
805408768
709232152
75622...

result:

ok OK!

Test #15:

score: 0
Accepted
time: 2647ms
memory: 147660kb

input:

199998
344064132
2066
301989920
83886244
1744994560
84017920
704909320
1090847234
1354825984
19407360
42205408
436469796
67963392
34621480
35652096
100673568
34734336
285356032
136316320
536912388
50667520
9199616
2099392
2621792
285220880
1182088
1581074
50320
17111168
67747856
20987920
672661780
1...

output:

22291712
16777288
6291460
94224
271648772
574619778
50306
134766728
537042976
616562880
1612743172
1073747466
402833440
201748
562102272
1091047744
1275076608
201326696
605555200
1145569344
4325538
1879048198
1140875264
538052610
38289408
549978176
17040648
51380738
4719888
402656768
9449984
6328450...

result:

ok OK!

Test #16:

score: -100
Memory Limit Exceeded

input:

199984
4402408632320
9034687045437440
18155138279542816
2269533733650432
9077568067863552
45176733762093056
4503668347109380
68719501312
563500280252416
10133374039506944
567382359670784
4329570308
144255925568405504
848827271610432
288233124932880384
162411061562179648
108086700294537232
2199137340...

output:


result: