QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#410764#73. Mineralsgelastropod40 13ms5500kbC++141.3kb2024-05-14 14:28:102024-05-14 14:28:11

Judging History

你现在查看的是最新测评结果

  • [2024-05-14 14:28:11]
  • 评测
  • 测评结果:40
  • 用时:13ms
  • 内存:5500kb
  • [2024-05-14 14:28:10]
  • 提交

answer

#include "minerals.h"
#include <bits/stdc++.h>
using namespace std;

void Solve(int N)
{
    int prev, curr;
    vector<int> firsts, seconds, vals(N, 0);
    vector<bool> on(N, false);
    for (int i = 1; i <= 2 * N; i++)
    {
        if (Query(i) > firsts.size())
        {
            firsts.push_back(i);
        }
        else seconds.push_back(i);
    }
    for (int i = 1; i <= 2 * N; i++) Query(i);
    for (int i = 0; i < 16; i++)
    {
        for (int j = 0; j < N; j++)
        {
            if (j & (1 << i))
            {
                if (!on[j]) prev = Query(firsts[j]);
                on[j] = true;
            }
        }
        for (int j = 0; j < N; j++)
        {
            curr = Query(seconds[j]);
            if (prev != curr)
            {
                prev = curr;
            }
            else
            {
                vals[j] += 1 << i;
            }
        }
        for (int j = 0; j < N; j++) Query(seconds[j]);
        for (int j = 0; j < N; j++)
        {
            if (j & (1 << i))
            {
                if (!(j & (1 << (i + 1))))
                {
                    Query(firsts[j]);
                    on[j] = false;
                }
            }
        }
    }
    for (int i = 0; i < N; i++)
    {
        Answer(firsts[vals[i]], seconds[i]);
    }
}

詳細信息

Subtask #1:

score: 6
Accepted

Test #1:

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

input:

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

output:

Accepted: 382

result:

ok 382 step(s)

Test #2:

score: 0
Accepted
time: 0ms
memory: 3764kb

input:

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

output:

Accepted: 382

result:

ok 382 step(s)

Test #3:

score: 0
Accepted
time: 0ms
memory: 3776kb

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: 3998

result:

ok 3998 step(s)

Test #4:

score: 0
Accepted
time: 0ms
memory: 3808kb

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: 3998

result:

ok 3998 step(s)

Subtask #2:

score: 25
Accepted

Test #5:

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

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: 41536

result:

ok 41536 step(s)

Test #6:

score: 0
Accepted
time: 0ms
memory: 3876kb

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: 84072

result:

ok 84072 step(s)

Test #7:

score: 0
Accepted
time: 0ms
memory: 3964kb

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: 170144

result:

ok 170144 step(s)

Test #8:

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

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: 344288

result:

ok 344288 step(s)

Test #9:

score: 0
Accepted
time: 7ms
memory: 4364kb

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: 653368

result:

ok 653368 step(s)

Subtask #3:

score: 9
Accepted

Test #10:

score: 9
Accepted
time: 1ms
memory: 3840kb

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: 41536

result:

ok 41536 step(s)

Test #11:

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

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: 431912

result:

ok 431912 step(s)

Test #12:

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

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: 653368

result:

ok 653368 step(s)

Test #13:

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

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: 653368

result:

ok 653368 step(s)

Test #14:

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

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: 653368

result:

ok 653368 step(s)

Subtask #4:

score: 0
Wrong Answer

Test #15:

score: 0
Wrong Answer
time: 12ms
memory: 5248kb

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:

Wrong Answer [2]

result:

wrong answer 

Subtask #5:

score: 0
Wrong Answer

Test #19:

score: 0
Wrong Answer
time: 12ms
memory: 5316kb

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:

Wrong Answer [2]

result:

wrong answer 

Subtask #6:

score: 0
Wrong Answer

Test #23:

score: 0
Wrong Answer
time: 12ms
memory: 5328kb

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:

Wrong Answer [2]

result:

wrong answer 

Subtask #7:

score: 0
Wrong Answer

Test #27:

score: 0
Wrong Answer
time: 13ms
memory: 5388kb

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:

Wrong Answer [2]

result:

wrong answer 

Subtask #8:

score: 0
Wrong Answer

Test #31:

score: 0
Wrong Answer
time: 13ms
memory: 5396kb

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

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