QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#773633#5147. Stack SortHuangHanShengTL 492ms3824kbC++17686b2024-11-23 09:38:482024-11-23 09:38:48

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3796kb

input:

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

output:

3
1
4

result:

ok 3 number(s): "3 1 4"

Test #2:

score: 0
Accepted
time: 112ms
memory: 3792kb

input:

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

output:

2
2
3
2
3
2
2
5
3
3
2
3
1
2
3
4
3
3
2
2
3
3
3
3
3
5
4
3
3
2
3
2
3
3
3
2
2
4
2
4
3
2
4
2
3
4
2
3
3
2
3
3
2
3
2
3
2
3
3
3
3
3
3
2
2
3
2
2
3
3
2
2
2
3
3
3
3
3
2
2
3
3
3
3
4
3
3
3
3
3
4
3
2
3
3
2
3
3
3
3
2
4
3
3
2
1
4
2
3
2
2
3
2
2
3
3
2
2
2
3
3
2
4
4
2
3
2
2
2
3
3
3
2
4
3
2
3
3
3
3
3
4
2
2
1
2
3
4
3
3
...

result:

ok 100000 numbers

Test #3:

score: 0
Accepted
time: 80ms
memory: 3824kb

input:

50000
10
3 1 2 10 6 8 5 4 7 9
10
8 3 9 2 10 4 5 1 7 6
9
6 8 4 9 5 7 1 3 2
9
6 7 9 3 8 5 2 1 4
10
7 10 1 2 6 5 3 9 4 8
10
1 10 4 3 2 9 7 8 5 6
9
1 5 3 4 9 6 7 2 8
10
4 7 2 8 3 6 9 5 10 1
9
6 4 9 1 8 5 2 3 7
10
5 1 7 8 10 3 9 6 2 4
9
4 8 6 3 9 7 5 2 1
9
9 1 7 6 2 3 8 5 4
10
5 7 2 1 4 3 6 8 9 10
10
9 7...

output:

5
6
5
4
5
5
6
6
5
6
4
5
6
6
6
5
7
7
5
6
5
5
7
5
8
3
6
5
5
6
4
5
6
4
5
4
4
5
4
4
6
5
5
6
5
4
7
4
5
7
5
5
7
4
7
4
6
5
6
4
6
6
5
4
5
6
5
5
6
5
3
5
5
5
5
6
7
6
5
5
7
3
5
5
7
5
6
4
5
4
6
5
4
6
5
7
5
5
6
5
6
6
3
6
6
4
5
6
5
5
5
4
6
3
5
4
6
5
5
7
5
5
6
6
4
4
6
5
7
5
6
3
6
3
5
5
5
4
5
5
5
6
6
4
6
6
5
4
5
6
...

result:

ok 50000 numbers

Test #4:

score: 0
Accepted
time: 148ms
memory: 3760kb

input:

5000
94
69 86 59 9 67 89 24 63 14 18 16 11 19 46 23 40 4 55 53 61 30 3 78 29 15 74 32 41 51 13 77 47 66 92 57 45 42 21 62 43 26 1 84 75 71 54 73 36 39 48 88 8 80 64 58 10 60 76 17 70 25 37 38 6 72 91 7 20 68 2 35 44 90 79 50 93 81 94 27 33 5 52 28 82 56 87 31 22 83 34 65 85 49 12
97
44 97 28 56 95 6...

output:

48
48
50
49
43
48
47
42
42
47
42
49
50
47
43
44
53
49
46
46
51
53
51
55
55
45
47
47
46
50
47
48
48
48
52
46
49
50
51
49
48
50
51
43
53
45
50
46
46
45
47
49
51
48
50
49
44
49
53
45
45
48
48
48
49
47
44
44
51
45
50
49
50
45
48
49
48
51
47
49
53
47
49
44
48
48
44
50
47
50
51
44
53
42
52
55
50
49
47
48
...

result:

ok 5000 numbers

Test #5:

score: 0
Accepted
time: 492ms
memory: 3632kb

input:

500
959
670 618 579 212 780 557 380 412 672 951 777 921 684 768 99 952 140 122 139 919 623 17 911 18 880 790 625 505 307 747 801 754 783 146 757 263 285 228 719 640 199 193 105 234 847 842 348 159 823 577 466 954 850 851 643 802 819 317 826 55 617 690 604 229 570 254 759 575 498 240 397 736 864 415 ...

output:

473
472
468
454
477
480
484
457
472
443
469
507
483
476
493
495
491
481
500
480
514
447
484
483
453
468
444
456
474
468
501
485
461
499
458
483
506
516
475
464
446
465
475
475
446
457
500
493
478
481
451
452
473
464
442
505
493
483
486
448
499
464
477
483
507
491
442
490
480
492
492
472
473
459
464
...

result:

ok 500 numbers

Test #6:

score: -100
Time Limit Exceeded

input:

50
9597
2421 5801 7761 5556 4158 3033 4751 9284 3326 1858 2849 8472 5917 6077 4438 1948 5294 3028 4716 8042 2671 5305 5076 6924 5569 8173 6362 2160 3095 7385 1374 3167 8128 551 2363 1371 5799 3273 1366 5050 7680 198 5577 1236 2843 1127 5381 3029 6977 4823 702 8077 528 526 7027 4278 7947 6058 5005 90...

output:

4807
4635
4549
4566
4833
4548
4946
4695

result: