QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#142311#5163. 喵了个喵olriutre40 573ms62472kbC++148.9kb2023-08-18 22:35:372023-08-18 22:35:40

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 5
Accepted
time: 410ms
memory: 3800kb

input:

1001
300 1814 598
483 60 555 101 51 354 9 252 396 527 380 573 243 98 143 305 16 355 479 117 594 369 522 368 133 534 598 353 475 161 68 250 4 119 137 12 370 532 72 152 40 314 249 182 397 71 164 513 198 539 283 121 440 548 56 439 434 64 336 132 514 339 52 350 21 421 304 156 268 87 338 419 540 583 139 ...

output:

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

result:

ok Right Output!!! (1001 test cases)

Test #2:

score: 5
Accepted
time: 435ms
memory: 9688kb

input:

1001
300 99724 598
345 381 76 48 555 574 99 55 233 363 511 21 268 552 390 442 284 356 291 572 132 251 185 123 247 436 410 254 74 507 567 418 421 44 597 510 151 229 98 516 591 10 70 392 562 592 236 379 349 60 485 480 71 136 222 40 546 476 113 586 444 64 540 195 583 304 423 214 221 548 224 422 341 319...

output:

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

result:

ok Right Output!!! (1001 test cases)

Test #3:

score: 5
Accepted
time: 417ms
memory: 3912kb

input:

1001
300 1870 598
232 396 237 207 403 576 164 510 388 568 180 574 321 589 140 209 129 420 555 124 575 552 415 486 143 85 275 421 267 408 55 64 46 393 598 155 556 542 60 91 52 455 543 42 153 303 548 241 426 59 194 243 78 469 459 352 291 128 161 477 323 339 272 493 361 366 569 456 22 409 532 195 537 8...

output:

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

result:

ok Right Output!!! (1001 test cases)

Test #4:

score: 0
Runtime Error

input:

1002
2 100000 3
2 3 1 2 1 1 2 2 1 2 1 3 2 3 1 2 1 1 2 1 2 1 3 3 1 2 1 2 2 3 2 1 3 3 2 1 2 1 3 2 1 3 2 3 1 1 3 1 2 1 3 1 2 2 2 2 1 1 2 1 2 1 1 1 2 3 1 2 2 1 3 2 3 3 2 3 3 2 2 1 3 2 1 2 3 2 3 1 3 2 1 2 3 3 2 1 2 3 2 3 1 2 2 3 1 2 1 2 3 1 2 3 3 1 2 1 2 2 1 1 2 1 3 3 2 2 2 2 1 3 3 1 2 1 1 1 1 2 2 3 3 1 ...

output:


result:


Test #5:

score: 0
Runtime Error

input:

1002
2 1994 3
3 1 2 1 1 3 2 1 3 2 1 1 3 1 2 3 3 2 1 3 3 2 3 2 1 3 1 1 3 1 3 1 3 3 1 3 1 2 2 3 2 3 3 2 2 1 1 2 3 2 3 1 3 2 1 3 2 1 1 2 3 1 2 1 2 3 1 1 3 2 1 2 2 3 2 3 1 1 2 2 1 1 2 3 2 3 1 2 1 3 1 2 3 2 2 2 1 3 1 3 2 1 3 1 3 3 3 3 3 2 1 3 3 2 1 2 1 2 1 1 2 3 1 3 2 2 1 3 2 1 3 1 2 3 2 1 3 1 3 3 1 2 3 ...

output:


result:


Test #6:

score: 0
Runtime Error

input:

1002
2 99998 3
2 3 1 3 3 1 3 1 3 1 3 3 1 1 2 2 1 1 2 1 1 1 3 3 3 3 2 1 3 1 3 1 1 3 3 1 1 2 2 1 1 2 2 1 3 3 1 1 1 2 2 3 3 1 2 1 1 1 3 2 1 1 3 3 3 1 3 3 2 1 3 1 2 3 3 3 3 1 1 2 3 2 2 2 1 3 3 2 2 2 2 2 2 2 3 2 2 2 3 3 2 3 2 3 3 2 1 1 2 2 3 2 3 1 2 2 1 2 3 1 2 1 2 2 3 3 1 1 2 3 3 3 3 1 3 2 3 1 2 1 1 2 2...

output:


result:


Test #7:

score: 5
Accepted
time: 1ms
memory: 3560kb

input:

3
3 14 5
1 2 3 4 5 1 5 5 4 3 5 4 2 4
3 14 5
1 2 3 4 5 2 5 3 5 1 1 4 5 1
3 14 5
1 2 3 4 5 1 4 1 4 1 5 4 2 3

output:

18
1 2
1 2
1 3
1 3
1 2
1 1
2 2 1
1 2
1 2
1 3
1 1
2 3 1
1 2
1 1
1 3
2 2 3
1 2
2 1 2
19
1 2
1 2
1 3
1 3
1 1
1 2
1 1
1 1
2 3 1
1 2
1 1
2 2 1
1 2
1 1
2 3 1
1 3
2 2 3
1 3
2 2 3
17
1 2
1 2
1 3
1 3
1 2
1 1
2 2 1
1 3
1 3
1 1
1 3
1 2
1 1
1 1
2 2 1
1 2
2 3 2

result:

ok Right Output!!! (3 test cases)

Test #8:

score: 5
Accepted
time: 1ms
memory: 3472kb

input:

3
3 14 5
1 2 3 4 5 4 1 1 3 2 4 1 4 5
3 14 5
1 2 3 4 5 4 3 5 3 5 1 2 3 5
3 14 5
1 2 3 4 5 5 3 2 5 5 1 2 2 4

output:

19
1 2
1 2
1 3
1 3
1 2
1 3
1 1
2 2 1
1 3
1 1
2 3 1
1 1
2 2 1
1 2
1 1
2 3 1
1 2
1 3
2 2 3
19
1 2
1 2
1 3
1 3
1 1
1 3
1 3
1 3
2 1 3
1 3
1 3
1 1
2 2 1
1 1
2 2 1
1 2
2 3 2
1 2
2 3 2
18
1 2
1 2
1 3
1 3
1 1
1 1
1 1
2 3 1
1 2
1 2
1 2
1 1
2 2 1
1 1
1 2
2 1 2
1 1
2 3 1

result:

ok Right Output!!! (3 test cases)

Test #9:

score: 5
Accepted
time: 1ms
memory: 3484kb

input:

3
3 14 5
1 2 3 4 5 3 4 1 2 4 1 1 4 5
3 14 5
1 2 3 4 5 3 2 2 3 5 4 2 3 1
3 14 5
1 2 3 4 5 4 3 2 5 1 1 1 5 5

output:

20
1 2
1 2
1 3
1 3
1 3
1 1
2 3 1
1 1
2 3 1
1 1
2 2 1
1 1
2 2 1
1 1
1 1
1 1
1 2
2 1 2
1 1
2 3 1
17
1 2
1 2
1 3
1 3
1 3
1 1
2 3 1
1 2
1 2
1 1
1 3
1 3
1 2
1 3
2 1 3
1 1
2 2 1
18
1 2
1 2
1 3
1 3
1 1
1 3
1 3
1 2
1 3
2 1 3
1 1
2 2 1
1 1
1 2
2 1 2
1 2
1 1
2 2 1

result:

ok Right Output!!! (3 test cases)

Test #10:

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

input:

3
3 14 5
1 2 3 4 5 5 2 3 1 5 3 3 5 4
3 14 5
1 2 3 4 5 4 5 2 5 5 5 5 1 3
3 14 5
1 2 3 4 5 5 5 4 5 4 4 2 3 1

output:

18
1 2
1 2
1 3
1 3
1 1
1 1
1 2
1 1
2 3 1
1 1
2 2 1
1 1
1 1
1 1
1 2
2 1 2
1 1
2 3 1
16
1 2
1 2
1 3
1 3
1 1
1 3
1 1
1 2
1 2
1 2
1 2
1 2
1 1
2 2 1
1 2
2 3 2
16
1 2
1 2
1 3
1 3
1 1
1 1
1 1
1 3
1 1
1 3
1 3
1 2
1 1
2 3 1
1 3
2 2 3

result:

ok Right Output!!! (3 test cases)

Test #11:

score: 0
Runtime Error

input:

1004
3 1992 5
4 5 2 3 1 5 5 1 4 3 5 1 4 5 3 5 3 1 4 4 5 3 1 2 2 1 3 2 5 2 5 3 1 4 5 5 3 5 4 2 1 3 2 5 1 1 4 5 5 4 1 4 2 2 4 4 2 3 3 2 4 2 1 5 1 3 4 3 2 4 5 2 3 3 5 1 3 5 2 3 1 4 1 4 4 5 2 2 4 1 5 2 2 4 1 3 1 3 4 4 4 2 5 3 5 4 1 2 1 4 3 3 3 3 3 3 3 2 4 2 4 1 1 5 2 1 2 2 1 5 4 3 1 4 1 3 2 3 1 4 1 2 1 ...

output:


result:


Test #12:

score: 0
Runtime Error

input:

1004
3 100000 5
3 5 2 4 1 5 3 2 1 5 3 2 1 5 3 2 4 5 3 2 4 5 3 1 2 5 3 1 2 5 3 1 2 5 3 1 2 5 3 4 2 5 3 4 2 5 1 3 4 5 1 3 4 2 1 3 4 2 1 5 3 4 1 5 2 3 1 5 2 3 1 5 2 3 1 4 5 3 2 4 5 1 2 4 5 1 2 4 5 3 1 4 5 3 2 1 4 5 2 1 4 3 2 1 4 3 2 1 5 3 4 1 5 3 4 2 5 1 3 2 5 1 3 4 2 5 1 4 2 5 1 4 3 2 5 4 3 2 5 4 1 3 ...

output:

141069
1 2
1 2
1 3
1 3
1 1
1 2
1 2
1 2
2 3 2
1 2
2 1 2
1 2
1 2
1 3
1 2
1 1
2 2 1
1 1
2 2 1
1 3
1 1
2 3 1
1 1
1 1
1 2
1 1
1 3
2 1 3
1 3
2 1 3
1 3
2 2 3
1 3
2 2 3
1 1
1 3
1 3
1 3
1 1
1 2
2 3 2
1 2
2 3 2
1 2
2 3 2
1 1
1 2
1 2
1 2
1 1
1 3
2 2 3
1 3
2 1 3
1 2
1 2
1 3
1 3
1 1
1 2
1 2
1 2
2 3 2
1 2
2 3 2
1...

result:


Test #13:

score: 0
Runtime Error

input:

1004
3 1990 5
1 2 4 5 3 3 1 5 4 4 5 3 1 5 2 5 4 4 2 1 2 1 1 3 4 4 2 3 1 3 1 4 5 3 5 4 1 2 2 2 5 3 5 5 4 3 5 4 2 2 5 5 5 1 4 5 2 4 1 3 1 2 4 1 2 3 4 1 3 3 4 2 2 4 1 4 5 2 2 4 5 4 2 2 5 4 4 4 5 1 2 1 4 2 2 4 4 2 5 5 4 3 4 4 5 3 1 3 2 3 5 2 1 1 1 4 5 3 5 3 4 1 4 1 4 2 4 4 4 5 1 5 1 2 4 4 4 3 3 1 3 1 2 ...

output:


result:


Test #14:

score: 0
Runtime Error

input:

1004
3 99998 5
2 1 3 4 5 2 1 3 4 2 1 3 4 2 1 5 3 2 1 5 3 4 2 5 1 4 2 5 1 3 4 5 1 3 4 5 1 3 4 5 2 3 4 5 1 2 4 5 1 2 3 4 5 2 3 4 1 5 2 4 1 5 2 4 1 3 2 4 1 3 2 5 4 1 3 5 4 1 3 2 4 1 3 2 4 1 3 2 4 5 1 3 4 5 2 1 3 4 5 1 2 4 5 1 2 3 5 1 4 3 5 1 4 2 3 1 4 2 3 1 4 2 5 1 3 2 5 1 3 4 2 1 3 4 2 1 3 5 4 1 3 5 2...

output:

141032
1 2
1 2
1 3
1 3
1 2
1 1
2 2 1
1 1
2 2 1
1 1
2 3 1
1 1
2 3 1
1 1
1 1
1 2
1 1
1 3
2 1 3
1 3
2 1 3
1 3
2 2 3
1 3
2 2 3
1 1
1 3
1 3
1 1
1 2
2 1 2
1 2
2 1 2
1 3
1 2
2 3 2
1 1
1 2
1 2
1 1
1 3
2 1 3
1 3
2 1 3
1 2
1 3
2 1 3
1 2
1 3
1 3
1 3
1 2
1 1
2 3 1
1 1
2 3 1
1 1
2 2 1
1 1
1 1
1 3
1 2
2 3 2
1 3
1...

result:


Test #15:

score: 0
Runtime Error

input:

1005
300 1908 599
161 199 80 536 40 121 528 569 337 568 8 547 86 424 333 220 439 500 210 515 593 5 75 466 537 352 372 513 451 87 554 209 261 482 415 597 450 422 182 535 484 580 506 563 200 582 101 409 135 95 51 198 587 561 514 359 112 429 435 383 418 96 266 233 331 116 293 150 289 414 130 432 377 56...

output:

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

result:


Test #16:

score: 0
Runtime Error

input:

1005
300 99936 599
512 185 499 176 447 476 341 332 298 68 191 231 198 536 252 220 259 113 265 438 579 284 418 212 179 467 498 105 361 170 205 273 354 104 87 201 217 427 171 152 494 382 329 535 34 186 194 146 88 32 362 372 449 573 550 553 109 292 315 278 496 225 270 237 311 470 453 375 242 269 40 24 ...

output:

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

result:


Test #17:

score: 0
Runtime Error

input:

1005
300 1886 599
451 344 162 305 593 146 549 590 299 495 258 419 77 45 171 220 48 246 124 560 317 321 131 588 500 395 207 460 34 240 123 583 194 427 215 339 377 205 275 509 101 95 585 145 502 442 193 148 566 390 464 524 520 90 62 315 296 521 535 553 108 157 147 371 213 398 458 313 492 81 394 523 28...

output:

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

result:


Test #18:

score: 0
Runtime Error

input:

1005
300 99736 599
497 195 73 245 116 464 389 581 366 205 272 386 586 471 22 590 112 345 138 236 219 243 524 392 302 306 62 157 465 399 380 1 593 452 346 317 35 327 83 476 237 106 462 127 91 456 110 228 329 328 470 491 121 409 434 419 565 300 455 86 435 182 431 453 396 109 330 270 214 429 15 578 519...

output:

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

result:


Test #19:

score: 0
Runtime Error

input:

1005
300 1966 599
291 319 439 495 23 192 348 560 588 454 219 46 564 99 322 503 272 246 350 41 284 337 335 168 573 491 50 94 59 96 413 497 590 435 327 576 33 552 68 252 597 587 557 488 128 229 135 477 506 56 451 241 224 62 370 273 466 463 332 562 513 190 585 430 403 19 382 471 507 18 141 494 574 29 2...

output:

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

result:


Test #20:

score: 5
Accepted
time: 573ms
memory: 62472kb

input:

1005
300 1997946 599
492 539 331 519 105 510 521 334 251 416 147 16 528 224 469 253 309 53 57 567 60 502 151 533 522 283 599 355 197 484 531 527 41 274 76 561 166 47 449 219 194 465 417 571 38 126 25 94 84 596 119 18 156 402 254 148 394 88 270 326 252 310 237 327 509 374 358 259 205 460 405 22 432 4...

output:

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

result:

ok Right Output!!! (1005 test cases)