QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#128607#2296. Exchange Studentslmq26052003WA 798ms110684kbC++176.5kb2023-07-21 12:47:502023-07-21 12:47:54

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 9ms
memory: 66076kb

input:

1
279122803
279122803

output:

0

result:

ok good

Test #2:

score: 0
Accepted
time: 14ms
memory: 65876kb

input:

2
212545283 896408766
212545283 896408766

output:

0

result:

ok good

Test #3:

score: 0
Accepted
time: 14ms
memory: 66124kb

input:

4
3 1 2 4
4 2 1 3

output:

2
2 3
1 4

result:

ok good

Test #4:

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

input:

6
5 1 2 3 4 6
6 4 3 2 1 5

output:

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

result:

ok good

Test #5:

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

input:

2
2 1
1 2

output:

1
2 1

result:

ok good

Test #6:

score: 0
Accepted
time: 16ms
memory: 65980kb

input:

4
3 2 2 1
2 1 2 3

output:

4
4 3
3 2
3 1
4 3

result:

ok good

Test #7:

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

input:

9
708443928 333343028 130113530 997808421 299459189 845949632 647591888 681805948 468112900
299459189 997808421 130113530 845949632 647591888 681805948 468112900 708443928 333343028

output:

13
5 4
4 2
2 1
4 5
5 6
6 7
7 8
8 9
8 7
6 5
8 6
2 4
4 8

result:

ok good

Test #8:

score: 0
Accepted
time: 11ms
memory: 64764kb

input:

3
732684994 647116406 457545388
732684994 647116406 457545388

output:

0

result:

ok good

Test #9:

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

input:

4
105385396 776935185 411665343 757889658
776935185 411665343 757889658 105385396

output:

3
1 2
2 3
3 4

result:

ok good

Test #10:

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

input:

4
1 2 2 1
2 2 1 1

output:

2
1 2
2 3

result:

ok good

Test #11:

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

input:

10
1 2 1 2 1 1 2 2 2 1
1 2 2 2 2 1 1 2 1 1

output:

8
6 7
7 8
8 9
5 6
6 7
3 4
4 5
5 6

result:

ok good

Test #12:

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

input:

5
1 1 2 2 2
2 1 1 2 2

output:

2
2 3
1 2

result:

ok good

Test #13:

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

input:

10
1 2 1 3 2 2 3 3 1 2
1 2 2 2 2 3 3 1 3 1

output:

11
3 4
4 5
5 6
6 7
7 8
9 10
4 3
5 4
9 7
7 6
6 5

result:

ok good

Test #14:

score: 0
Accepted
time: 9ms
memory: 65908kb

input:

6
4 2 1 4 1 4
4 1 2 1 4 4

output:

2
3 2
5 4

result:

ok good

Test #15:

score: 0
Accepted
time: 14ms
memory: 65948kb

input:

6
4 5 4 6 5 2
5 4 2 4 5 6

output:

5
6 5
5 4
4 3
1 2
6 5

result:

ok good

Test #16:

score: 0
Accepted
time: 9ms
memory: 64540kb

input:

6
4 3 8 5 1 2
5 8 2 4 1 3

output:

7
6 4
4 3
2 4
4 6
1 2
2 4
2 1

result:

ok good

Test #17:

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

input:

112
633894500 167641802 339937464 844945998 269698167 432803430 591795000 657246871 31461268 443731992 6055837 817590568 986936937 160504265 528606045 304078549 879939770 433943593 793192949 260825675 586504056 752833202 507520443 563583937 733291184 91069383 362243954 908994979 651876073 944319771 ...

output:

2255
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
100 99
99 98
98 97
97 96
96 95
95 94
94 93
93 92
92 91
91 90
90 89
89 88
88 87
87 86
86 85
85 84
84 83
83 82
82 81
81 80
80 79
79 78
78 77
77 76
76 75
75 74
...

result:

ok good

Test #18:

score: 0
Accepted
time: 27ms
memory: 66180kb

input:

475
513851595 939887761 535431296 196631717 780659274 904345731 960702202 930549847 783401281 700008841 764948141 408683368 580730549 656069530 812938319 239750378 509869370 458659369 111931962 953621825 247129346 579636113 197526284 860965062 770656291 712648065 719627561 994512440 776717865 721575...

output:

38843
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
52 53
53 54
54 55
55 56
56 57
57 58
58 59
59 60
60 61
61 62
62 63
63 64
64 65
65 66
66 67
67 68
68 69
69 70
70 71
71 72
72 73
73 74
74 75
75 76
76 77
77 78
78 79
79 80
80 81
81 82
82 83
83 84
84 85
85 86
86 87
87 88
88 89
89 90
...

result:

ok good

Test #19:

score: 0
Accepted
time: 22ms
memory: 65592kb

input:

511
692538384 450798311 689060453 338600390 623425233 806325979 214986187 65806871 160563193 565038083 651234761 686197630 390054944 16695632 976193125 348998588 109084352 295378672 886085460 966887442 454774074 452488333 950625229 873137681 490203016 343841646 453468043 199579268 254523368 59890754...

output:

41191
182 183
183 184
184 185
185 186
186 187
187 188
188 189
189 190
190 191
191 192
192 193
193 194
194 195
195 196
196 197
197 198
198 199
199 200
200 201
201 202
202 203
203 204
204 205
205 206
206 207
207 208
208 209
209 210
210 211
211 212
212 213
213 214
214 215
215 216
216 217
217 218
218 21...

result:

ok good

Test #20:

score: 0
Accepted
time: 170ms
memory: 69700kb

input:

6529
742820256 407098265 340024622 783273460 90005697 317112311 638332065 979785745 10427038 998056248 711257071 670551250 993934171 563965867 740492636 477441398 446620497 782019827 436884507 80766292 73444545 628480256 914515547 747218815 252222910 629497196 601718131 468014294 722599489 976762176...

output:

7165684
178 179
179 180
180 181
181 182
182 183
183 184
184 185
185 186
186 187
187 188
188 189
189 190
190 191
191 192
192 193
193 194
194 195
195 196
196 197
197 198
198 199
199 200
200 201
201 202
202 203
203 204
204 205
205 206
206 207
207 208
208 209
209 210
210 211
211 212
212 213
213 214
214 ...

result:

ok good

Test #21:

score: 0
Accepted
time: 307ms
memory: 75064kb

input:

49656
219729028 922565163 973184177 401278488 398509977 430136880 355221823 531198609 427159272 620342214 807056246 946023229 863329676 594785601 919885246 514268227 322020072 283161368 230524610 216372594 971966245 750604631 235100536 294361839 700788364 78618139 559468465 858060770 714675158 94275...

output:

410203271
47389 47388
47388 47387
47387 47386
47386 47385
47385 47384
47384 47383
47383 47382
47382 47381
47381 47380
47380 47379
47379 47378
47378 47377
47377 47376
47376 47375
47375 47374
47374 47373
47373 47372
47372 47371
47371 47370
47370 47369
47369 47368
47368 47367
47367 47366
47366 47365
47...

result:

ok good

Test #22:

score: 0
Accepted
time: 531ms
memory: 87336kb

input:

143669
948851763 284443096 962878315 551277661 202354141 381651768 403739560 826584405 363147562 724688034 670173153 506757091 350542543 655812219 60748415 522515497 41316518 689650777 261560751 125071377 69204090 943711167 165930454 226368865 920920481 458809698 371422646 842157114 24781050 7796296...

output:

3440983752
109079 109078
109078 109077
109077 109076
109076 109075
109075 109074
109074 109073
109073 109072
109072 109071
109071 109070
109070 109069
109069 109068
109068 109067
109067 109066
109066 109065
109065 109064
109064 109063
109063 109062
109062 109061
109061 109060
109060 109059
109059 10...

result:

ok good

Test #23:

score: 0
Accepted
time: 798ms
memory: 109152kb

input:

300000
331520194 609970309 604859193 816982812 725275830 848832553 819288112 916926379 193011613 436808431 53021469 38879580 455498144 387664917 824677349 258913448 967649601 259681227 672184202 936087138 579468080 716313897 121681024 568713806 32234516 783526144 244218286 423421704 256589283 747706...

output:

15016413052
206667 206666
206666 206665
206665 206664
206664 206663
206663 206662
206662 206661
206661 206660
206660 206659
206659 206658
206658 206657
206657 206656
206656 206655
206655 206654
206654 206653
206653 206652
206652 206651
206651 206650
206650 206649
206649 206648
206648 206647
206647 2...

result:

ok good

Test #24:

score: -100
Wrong Answer
time: 795ms
memory: 110684kb

input:

300000
416161145 142034803 687753433 586352821 818995942 920991843 909428809 134612316 468444784 932090888 907047166 658380288 342653817 153914548 682888570 433423150 709429365 500294745 496103894 471710770 194392504 370866028 138123366 751752703 411914434 322763592 603804776 126892125 514141682 314...

output:

14986242618
51484 51485
51485 51486
51486 51487
51487 51488
51488 51489
51489 51490
51490 51491
51491 51492
51492 51493
51493 51494
51494 51495
51495 51496
51496 51497
51497 51498
51498 51499
51499 51500
51500 51501
51501 51502
51502 51503
51503 51504
51504 51505
51505 51506
51506 51507
51507 51508
...

result:

wrong answer Swaps are not optimal