QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#831075#73. Mineralsmyd85 22ms6268kbC++141.0kb2024-12-25 10:18:002024-12-25 10:18:01

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 6
Accepted

Test #1:

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

input:

10
19 7
2 13
10 18
16 17
15 8
20 12
6 1
5 11
9 4
14 3

output:

Accepted: 67

result:

ok 67 step(s)

Test #2:

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

input:

10
1 20
2 14
9 12
8 19
7 18
10 16
6 17
5 15
4 13
3 11

output:

Accepted: 65

result:

ok 65 step(s)

Test #3:

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

input:

100
162 84
186 149
184 108
113 139
75 155
176 73
94 69
118 163
45 64
8 71
173 129
141 22
95 27
99 60
166 192
93 145
134 62
101 103
151 46
198 19
124 78
49 21
187 106
56 157
33 148
7 92
131 37
90 74
135 54
171 199
98 96
120 117
2 87
153 119
150 58
66 59
185 130
28 24
26 165
67 144
138 17
195 127
159 ...

output:

Accepted: 1124

result:

ok 1124 step(s)

Test #4:

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

input:

100
29 154
91 197
30 181
51 196
9 146
25 168
79 171
48 163
23 178
42 195
58 164
16 183
13 176
68 101
89 184
37 144
1 118
82 185
11 127
28 190
33 160
21 110
24 186
62 115
20 139
60 136
45 167
43 123
93 187
32 198
8 103
7 113
63 129
77 175
83 111
26 179
34 174
76 130
75 191
17 132
15 151
87 126
22 133...

output:

Accepted: 1115

result:

ok 1115 step(s)

Subtask #2:

score: 25
Accepted

Test #5:

score: 25
Accepted
time: 1ms
memory: 4152kb

input:

1000
71 1441
504 1818
856 1348
505 1014
246 1249
301 1054
733 1631
477 1146
890 1128
927 1037
752 1944
261 1453
677 1264
334 1292
649 1136
850 1535
372 1669
690 1465
552 1008
632 1546
953 1505
118 1343
877 1045
689 1463
406 1199
27 1904
409 1419
435 1468
983 1706
790 1756
998 1134
417 1339
676 1644
...

output:

Accepted: 16217

result:

ok 16217 step(s)

Test #6:

score: 25
Accepted
time: 1ms
memory: 3920kb

input:

2000
1349 3946
1668 3851
938 3402
1326 2177
1641 2125
600 3066
486 3222
1543 2600
1532 3340
658 2822
1842 3074
1744 3993
1862 3265
768 2095
1709 2957
1889 2325
1559 3641
1399 3338
1540 3154
1353 2359
1852 3708
21 2251
1463 3831
382 3695
496 2993
1498 2797
1829 2888
342 3003
417 2472
1860 2014
161 36...

output:

Accepted: 35432

result:

ok 35432 step(s)

Test #7:

score: 25
Accepted
time: 2ms
memory: 4004kb

input:

4000
1267 7461
3435 5752
302 6881
896 7086
740 7360
1723 6026
2326 5939
602 6151
3211 6764
2204 6217
1381 4511
1530 7705
3347 4550
1453 4466
375 4539
2915 7302
1020 6958
3455 6551
3264 4398
3639 5628
2140 6841
1695 5358
2319 5686
61 6236
1098 6942
3202 4733
1250 6748
735 4861
1873 7490
1002 6675
304...

output:

Accepted: 77042

result:

ok 77042 step(s)

Test #8:

score: 25
Accepted
time: 4ms
memory: 4172kb

input:

8000
6057 15277
5748 14311
6482 9314
6282 13576
3591 9304
7516 15823
3337 10480
4169 8083
6418 14182
5268 12481
3219 8575
4357 12737
2760 8508
692 13578
773 9185
5088 14211
2159 12817
374 11159
482 10801
5274 13443
1980 14269
6447 11128
6303 11248
4760 13146
7314 11074
758 11379
948 15982
6537 11560...

output:

Accepted: 165989

result:

ok 165989 step(s)

Test #9:

score: 25
Accepted
time: 2ms
memory: 4596kb

input:

15000
1720 16856
11497 16786
4541 15306
9308 27724
14794 27188
7181 20547
11132 16631
4401 17210
14857 23599
904 15942
4716 29129
9134 18313
3250 15245
13298 17926
3631 23733
13477 27567
8325 28835
3328 16355
1551 22767
6195 16677
6422 15065
14054 23999
5372 19520
1704 21864
852 18033
198 25118
2236...

output:

Accepted: 330456

result:

ok 330456 step(s)

Subtask #3:

score: 9
Accepted

Test #10:

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

input:

1000
1086 1459
1665 730
1828 1430
182 205
1390 430
692 506
1155 1564
1451 294
673 639
1100 149
1952 1866
1889 878
408 611
1139 154
300 1009
1395 1019
618 1845
1195 1596
1178 1384
569 1093
1147 1208
793 704
1677 977
641 1180
1357 1010
254 96
1581 948
1212 1254
283 312
1593 944
1960 1917
360 139
582 8...

output:

Accepted: 16248

result:

ok 16248 step(s)

Test #11:

score: 9
Accepted
time: 5ms
memory: 4468kb

input:

10000
631 5842
4518 18688
10206 6309
8165 19683
7969 14435
12948 4783
9155 9199
3542 5770
8155 9668
3930 17819
7686 7037
16564 14254
4348 10790
16164 4413
2573 10784
6849 10607
8097 10925
15008 13802
19166 19514
11551 19862
5391 6240
1458 15711
4512 9511
18411 17405
11239 10227
15652 10915
9739 1610...

output:

Accepted: 210459

result:

ok 210459 step(s)

Test #12:

score: 9
Accepted
time: 8ms
memory: 4656kb

input:

15000
1501 10507
11233 15966
2309 2664
10527 26908
3577 16793
11603 29080
17409 19332
12692 25622
16498 10187
11248 9620
21387 22218
21087 675
19666 22294
18528 4451
8034 16995
25193 10819
26725 22048
4410 1406
21274 17245
3880 8497
23353 22820
18287 10791
4180 28653
19171 428
12250 8755
4969 27018
...

output:

Accepted: 330252

result:

ok 330252 step(s)

Test #13:

score: 9
Accepted
time: 7ms
memory: 4628kb

input:

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

output:

Accepted: 330218

result:

ok 330218 step(s)

Test #14:

score: 9
Accepted
time: 7ms
memory: 4596kb

input:

15000
1 30000
2 29999
3 29998
4 29997
5 29996
6 29995
7 29994
8 29993
9 29992
10 29991
11 29990
12 29989
13 29988
14 29987
15 29986
16 29985
17 29984
18 29983
19 29982
20 29981
21 29980
22 29979
23 29978
24 29977
25 29976
26 29975
27 29974
28 29973
29 29972
30 29971
31 29970
32 29969
33 29968
34 299...

output:

Accepted: 330311

result:

ok 330311 step(s)

Subtask #4:

score: 30
Accepted

Test #15:

score: 30
Accepted
time: 16ms
memory: 5760kb

input:

38000
59215 52683
55301 10339
7136 74175
19615 367
627 25723
68621 47313
4022 50538
33743 20356
13177 26746
58664 38147
69175 75544
34036 43398
73372 7410
10431 12525
67205 11597
63717 11164
10715 51228
57281 71998
65259 18952
49981 28719
50966 73187
57158 73146
59836 7069
72392 75926
65552 9514
516...

output:

Accepted: 910127

result:

ok 910127 step(s)

Test #16:

score: 30
Accepted
time: 20ms
memory: 5772kb

input:

38000
42043 4613
72931 37371
64772 40140
15586 41022
52179 74255
18277 67727
70349 61422
73411 49654
43208 30620
56679 67602
54286 41747
40169 63867
42326 67867
42767 15025
21299 24669
2870 45966
36031 2199
51347 59137
4160 12047
32429 46907
30142 64602
41333 52743
44006 15362
1460 63613
5109 28605
...

output:

Accepted: 910563

result:

ok 910563 step(s)

Test #17:

score: 30
Accepted
time: 16ms
memory: 5948kb

input:

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

output:

Accepted: 910393

result:

ok 910393 step(s)

Test #18:

score: 30
Accepted
time: 19ms
memory: 5884kb

input:

38000
1 76000
2 75999
3 75998
4 75997
5 75996
6 75995
7 75994
8 75993
9 75992
10 75991
11 75990
12 75989
13 75988
14 75987
15 75986
16 75985
17 75984
18 75983
19 75982
20 75981
21 75980
22 75979
23 75978
24 75977
25 75976
26 75975
27 75974
28 75973
29 75972
30 75971
31 75970
32 75969
33 75968
34 759...

output:

Accepted: 910418

result:

ok 910418 step(s)

Subtask #5:

score: 5
Accepted

Test #19:

score: 5
Accepted
time: 21ms
memory: 5776kb

input:

39000
22259 19524
49412 72777
70627 33049
52935 18381
36470 34692
59059 61108
21181 37595
7448 1760
9314 31607
43425 45921
25297 44306
71633 41677
31654 51785
50494 28977
8138 14556
48595 21085
13474 68624
60145 55410
15273 30732
56392 26930
55409 45198
18152 14548
28482 61155
21608 62483
13202 6092...

output:

Accepted: 936142

result:

ok 936142 step(s)

Test #20:

score: 5
Accepted
time: 16ms
memory: 5804kb

input:

39000
34332 25676
45049 61185
31071 45627
76401 55032
17485 12670
11469 63739
70992 56827
22251 40754
33625 49349
49849 57168
12571 74540
75762 51260
23675 33053
39165 33671
53868 25299
6563 50651
21979 61791
27175 7858
24389 69005
21499 19279
63280 43547
18696 20862
30764 33055
70514 74845
14725 73...

output:

Accepted: 936044

result:

ok 936044 step(s)

Test #21:

score: 5
Accepted
time: 20ms
memory: 5708kb

input:

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

output:

Accepted: 935720

result:

ok 935720 step(s)

Test #22:

score: 5
Accepted
time: 20ms
memory: 5656kb

input:

39000
1 78000
2 77999
3 77998
4 77997
5 77996
6 77995
7 77994
8 77993
9 77992
10 77991
11 77990
12 77989
13 77988
14 77987
15 77986
16 77985
17 77984
18 77983
19 77982
20 77981
21 77980
22 77979
23 77978
24 77977
25 77976
26 77975
27 77974
28 77973
29 77972
30 77971
31 77970
32 77969
33 77968
34 779...

output:

Accepted: 936062

result:

ok 936062 step(s)

Subtask #6:

score: 5
Accepted

Test #23:

score: 5
Accepted
time: 22ms
memory: 6164kb

input:

40000
77595 17395
78532 3136
52560 17938
71960 78212
65773 73784
9210 40755
22431 33565
27704 5920
54686 12437
64706 77829
61984 31471
62411 49974
63743 41557
13662 21450
24433 63033
56164 37960
28803 14363
34466 72960
46737 368
17361 54062
4696 54496
77879 76259
75656 57095
66232 18361
68729 46965
...

output:

Accepted: 962115

result:

ok 962115 step(s)

Test #24:

score: 5
Accepted
time: 18ms
memory: 5824kb

input:

40000
41096 20251
66490 65231
38978 73676
29581 29080
10667 5398
55704 18822
32765 72295
62737 78965
78650 32708
25190 7928
39753 43313
43256 74109
24561 69191
398 4687
52369 4354
54714 23364
79710 16898
26968 36150
16344 10472
34431 22235
77591 5128
39608 11773
30983 55812
52747 35655
24613 77494
3...

output:

Accepted: 961707

result:

ok 961707 step(s)

Test #25:

score: 5
Accepted
time: 21ms
memory: 5808kb

input:

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

output:

Accepted: 961916

result:

ok 961916 step(s)

Test #26:

score: 5
Accepted
time: 20ms
memory: 5624kb

input:

40000
1 80000
2 79999
3 79998
4 79997
5 79996
6 79995
7 79994
8 79993
9 79992
10 79991
11 79990
12 79989
13 79988
14 79987
15 79986
16 79985
17 79984
18 79983
19 79982
20 79981
21 79980
22 79979
23 79978
24 79977
25 79976
26 79975
27 79974
28 79973
29 79972
30 79971
31 79970
32 79969
33 79968
34 799...

output:

Accepted: 961944

result:

ok 961944 step(s)

Subtask #7:

score: 5
Accepted

Test #27:

score: 5
Accepted
time: 22ms
memory: 5900kb

input:

41000
20874 15182
80174 4001
24055 24381
19335 42391
5765 39861
28079 46949
9053 71698
69207 11791
31981 57851
19636 49421
68545 72057
81934 41458
64695 3755
52792 31861
7895 18162
9597 48924
81569 80678
62690 53908
50769 63724
278 18237
56843 38451
39110 54788
59760 27167
43698 75607
44238 20803
26...

output:

Accepted: 989328

result:

ok 989328 step(s)

Test #28:

score: 5
Accepted
time: 18ms
memory: 5900kb

input:

41000
60042 24503
52044 18559
44276 61580
26355 64163
69821 55112
64941 46221
31270 17215
615 28621
70335 4488
79574 57007
69811 57679
23884 75597
67960 50150
81430 2299
19320 52029
47154 29335
33603 33944
43594 30879
39153 964
70717 899
51382 68309
24514 24868
39874 16747
39674 6521
72294 23253
188...

output:

Accepted: 989063

result:

ok 989063 step(s)

Test #29:

score: 5
Accepted
time: 21ms
memory: 5808kb

input:

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

output:

Accepted: 989125

result:

ok 989125 step(s)

Test #30:

score: 5
Accepted
time: 13ms
memory: 5716kb

input:

41000
1 82000
2 81999
3 81998
4 81997
5 81996
6 81995
7 81994
8 81993
9 81992
10 81991
11 81990
12 81989
13 81988
14 81987
15 81986
16 81985
17 81984
18 81983
19 81982
20 81981
21 81980
22 81979
23 81978
24 81977
25 81976
26 81975
27 81974
28 81973
29 81972
30 81971
31 81970
32 81969
33 81968
34 819...

output:

Accepted: 988880

result:

ok 988880 step(s)

Subtask #8:

score: 0
Wrong Answer

Test #31:

score: 0
Wrong Answer
time: 22ms
memory: 6236kb

input:

42000
40256 64311
22189 23808
12888 63256
37941 23894
63645 5344
5729 20427
18535 78027
25440 56073
45779 74076
77955 77961
10838 73121
3743 35880
15785 26949
16000 73643
28016 66721
73740 11332
38057 61890
70080 74190
5256 73895
39091 35407
71643 72100
39328 11151
44057 28416
26054 27895
51211 5268...

output:

Wrong Answer [2]

result:

wrong answer 

Subtask #9:

score: 0
Wrong Answer

Test #35:

score: 0
Wrong Answer
time: 22ms
memory: 6268kb

input:

43000
51972 74184
65517 14510
85263 49532
31788 1750
43544 8633
418 33357
26577 53596
32482 8713
67907 49133
47570 80150
71652 11337
40521 30582
46881 31714
25904 69177
60834 14368
7246 63195
80775 53724
17949 40374
3451 77149
27951 63639
41397 52162
24797 10441
30350 50445
44967 43314
50170 44303
1...

output:

Wrong Answer [2]

result:

wrong answer