QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#296960#2727. Gradient DescentCamillus#15 2ms3700kbC++201.4kb2024-01-03 20:27:192024-07-04 03:16:37

Judging History

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

  • [2024-07-04 03:16:37]
  • 评测
  • 测评结果:15
  • 用时:2ms
  • 内存:3700kb
  • [2024-01-03 20:27:19]
  • 提交

answer

/// @author Camillus <3
#ifndef LOCAL
#define debug(...) 42
#endif
#include "bits/stdc++.h"
using namespace std;

int query(int x, int y) {
    cout << "? " << x << " " << y << endl;
    int result;
    cin >> result;
    return result;
}

int answer(int s) {
    cout << "! " << s << endl;
    exit(0);
}


signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int R, C, L;
    cin >> R >> C >> L;

    int x, y;

    {
        int l = 0, r = C;

        while (r - l > 2) {
            int m1 = l + (r - l) / 3;
            int m2 = r - (r - l) / 3;

            if (query(0, m1) < query(0, m2)) {
                r = m2;
            } else {
                l = m1;
            }
        }

        y = l;
        for (int i = l + 1; i <= r; i++) {
            if (query(0, i) < query(0, y)) {
                y = i;
            }
        }
    }

    {
        int l = 0, r = R;

        while (r - l > 2) {
            int m1 = l + (r - l) / 3;
            int m2 = r - (r - l) / 3;

            if (query(m1, 0) < query(m2, 0)) {
                r = m2;
            } else {
                l = m1;
            }
        }

        x = l;
        for (int i = l + 1; i <= r; i++) {
            if (query(i, 0) < query(x, 0)) {
                x = i;
            }
        }
    }

    answer(query(x, y));
    return 0;
}

詳細信息

Subtask #1:

score: 5
Accepted

Test #1:

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

input:

1 90 90
4500
1500
2500
500
1200
400
300
800
600
200
200
400
400
200
200
200
100
300
100
200
100
200
200
100
7400
7500
0

output:

? 0 30
? 0 60
? 0 50
? 0 70
? 0 63
? 0 77
? 0 72
? 0 81
? 0 69
? 0 75
? 0 73
? 0 77
? 0 71
? 0 75
? 0 73
? 0 75
? 0 74
? 0 76
? 0 74
? 0 75
? 0 74
? 0 73
? 0 75
? 0 74
? 1 0
? 0 0
? 1 74
! 0

result:

ok Solution answered 0 ans asked 27 questions

Test #2:

score: 0
Accepted
time: 1ms
memory: 3644kb

input:

1 90 90
2758
2382
2318
2692
2369
2343
2318
2401
2319
2329
2325
2317
2319
2319
2317
2319
2318
2318
2317
2318
2317
2318
2318
2317
4851
4950
2218

output:

? 0 30
? 0 60
? 0 50
? 0 70
? 0 43
? 0 57
? 0 52
? 0 61
? 0 49
? 0 55
? 0 47
? 0 51
? 0 49
? 0 53
? 0 51
? 0 53
? 0 50
? 0 52
? 0 51
? 0 52
? 0 51
? 0 50
? 0 52
? 0 51
? 1 0
? 0 0
? 1 51
! 2218

result:

ok Solution answered 2218 ans asked 27 questions

Test #3:

score: 0
Accepted
time: 1ms
memory: 3644kb

input:

1 90 90
2886
2332
2338
2658
2458
2306
2318
2350
2350
2308
2314
2306
2308
2318
2308
2306
2306
2310
2306
2306
2306
2306
2310
2306
4890
4990
2206

output:

? 0 30
? 0 60
? 0 50
? 0 70
? 0 43
? 0 57
? 0 52
? 0 61
? 0 49
? 0 55
? 0 53
? 0 57
? 0 55
? 0 59
? 0 55
? 0 57
? 0 56
? 0 58
? 0 56
? 0 57
? 0 57
? 0 56
? 0 58
? 0 56
? 1 0
? 0 0
? 1 56
! 2206

result:

ok Solution answered 2206 ans asked 27 questions

Test #4:

score: 0
Accepted
time: 1ms
memory: 3660kb

input:

1 60 90
1743
1577
1456
1884
1476
1523
1523
1457
1467
1459
1457
1485
1457
1459
1462
1456
1457
1456
1456
1457
1459
1456
3134
3233
1357

output:

? 0 20
? 0 40
? 0 33
? 0 47
? 0 29
? 0 38
? 0 26
? 0 32
? 0 30
? 0 34
? 0 32
? 0 36
? 0 32
? 0 34
? 0 31
? 0 33
? 0 32
? 0 33
? 0 33
? 0 32
? 0 34
? 0 33
? 1 0
? 0 0
? 1 33
! 1357

result:

ok Solution answered 1357 ans asked 25 questions

Test #5:

score: 0
Accepted
time: 1ms
memory: 3588kb

input:

1 60 90
1768
1664
1518
2026
1514
1604
1556
1512
1510
1524
1518
1512
1510
1512
1514
1510
1510
1510
1510
1510
1512
1510
3018
3118
1410

output:

? 0 20
? 0 40
? 0 33
? 0 47
? 0 29
? 0 38
? 0 26
? 0 32
? 0 30
? 0 34
? 0 28
? 0 32
? 0 30
? 0 32
? 0 29
? 0 31
? 0 30
? 0 31
? 0 31
? 0 30
? 0 32
? 0 30
? 1 0
? 0 0
? 1 30
! 1410

result:

ok Solution answered 1410 ans asked 25 questions

Subtask #2:

score: 5
Accepted

Test #6:

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

input:

1 10000000 90
482333900
149000500
260111700
37889400
111963600
36184900
13198200
85567600
46120000
19724000
2224200
41671800
16856200
12408000
2653200
22162600
3850000
9156400
8185400
485600
2404900
3375900
4331700
478000
1762600
806800
49900
1663200
620800
521400
140600
902000
113300
394500
282500
...

output:

? 0 3333333
? 0 6666667
? 0 5555555
? 0 7777778
? 0 7037036
? 0 8518519
? 0 8024690
? 0 9012346
? 0 7695472
? 0 8353910
? 0 8134430
? 0 8573388
? 0 7988110
? 0 8280750
? 0 8183202
? 0 8378296
? 0 8118172
? 0 8248234
? 0 8074818
? 0 8161526
? 0 8132623
? 0 8190429
? 0 8113355
? 0 8151892
? 0 8139046
...

result:

ok Solution answered 0 ans asked 85 questions

Test #7:

score: 0
Accepted
time: 1ms
memory: 3584kb

input:

1 10000000 90
238205017
300761913
274248058
234479597
234511087
248026324
240550700
233738858
233596616
234952150
234895170
233409638
233377136
233848598
233669774
233263322
233279588
233458412
233409650
233209070
233236235
233284997
233294039
233199436
233216966
233212282
233203717
233233616
233198...

output:

? 0 3333333
? 0 6666667
? 0 2222222
? 0 4444445
? 0 3703703
? 0 5185186
? 0 3209876
? 0 4197532
? 0 3868312
? 0 4526750
? 0 3648834
? 0 4087792
? 0 3941472
? 0 4234112
? 0 3843926
? 0 4039020
? 0 3973988
? 0 4104050
? 0 3930634
? 0 4017342
? 0 3988439
? 0 4046245
? 0 3969171
? 0 4007708
? 0 3994862
...

result:

ok Solution answered 233194085 ans asked 85 questions

Test #8:

score: 0
Accepted
time: 1ms
memory: 3628kb

input:

1 10000000 90
244118532
315299614
280449648
243762020
241502606
257930650
246534948
240970438
240844170
244966256
241722082
240631278
240653170
241226146
240941714
240533734
240588138
240663794
240674846
240501430
240559236
240548184
240509646
240586720
240507854
240535338
240524982
240501084
240502...

output:

? 0 3333333
? 0 6666667
? 0 2222222
? 0 4444445
? 0 3703703
? 0 5185186
? 0 3209876
? 0 4197532
? 0 3868312
? 0 4526750
? 0 3648834
? 0 4087792
? 0 3941472
? 0 4234112
? 0 3843926
? 0 4039020
? 0 3973988
? 0 4104050
? 0 3930634
? 0 4017342
? 0 3988439
? 0 4046245
? 0 4026976
? 0 4065513
? 0 4014130
...

result:

ok Solution answered 240496324 ans asked 85 questions

Test #9:

score: 0
Accepted
time: 1ms
memory: 3584kb

input:

1 6666666 90
165966032
167014498
199322271
146303021
158770989
143167932
142685875
147625230
147674796
141741325
141729254
143643472
143149228
141328426
141501642
141952666
141805120
141281368
141400485
141350101
141292294
141451685
141291004
141330832
141316696
141279451
141282442
141296578
1412938...

output:

? 0 2222222
? 0 4444444
? 0 1481481
? 0 2962963
? 0 2469135
? 0 3456790
? 0 3127571
? 0 3786008
? 0 2908092
? 0 3347051
? 0 3200730
? 0 3493370
? 0 3103184
? 0 3298278
? 0 3233246
? 0 3363308
? 0 3189892
? 0 3276600
? 0 3247697
? 0 3305503
? 0 3286234
? 0 3324771
? 0 3273388
? 0 3299080
? 0 3264824
...

result:

ok Solution answered 141272281 ans asked 83 questions

Test #10:

score: 0
Accepted
time: 1ms
memory: 3640kb

input:

1 6666666 90
176111421
148235271
140732673
184349953
143228739
143189885
141061891
150704421
140622933
141873017
141472911
140915575
140720479
141110667
140692539
140850543
140952663
140677127
140619321
140734933
140721441
140657859
140632167
140683551
140618679
140649297
140652933
140626461
1406188...

output:

? 0 2222222
? 0 4444444
? 0 3703703
? 0 5185185
? 0 3209876
? 0 4197531
? 0 3868312
? 0 4526749
? 0 3648833
? 0 4087792
? 0 3502514
? 0 3795154
? 0 3697606
? 0 3892700
? 0 3632576
? 0 3762638
? 0 3589222
? 0 3675930
? 0 3647027
? 0 3704833
? 0 3627759
? 0 3666296
? 0 3653450
? 0 3679142
? 0 3644886
...

result:

ok Solution answered 140615849 ans asked 83 questions

Subtask #3:

score: 5
Accepted

Test #11:

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

input:

10000000 10000000 170
617967700
284634300
395745500
173523200
247597400
171818700
148832000
221201400
181753800
155357800
137858000
177305600
152490000
148041800
138287000
157796400
139483800
144790200
143819200
136119400
138038700
139009700
139965500
136111800
137396400
136440600
135683700
13729700...

output:

? 0 3333333
? 0 6666667
? 0 5555555
? 0 7777778
? 0 7037036
? 0 8518519
? 0 8024690
? 0 9012346
? 0 7695472
? 0 8353910
? 0 8134430
? 0 8573388
? 0 7988110
? 0 8280750
? 0 8183202
? 0 8378296
? 0 8118172
? 0 8248234
? 0 8074818
? 0 8161526
? 0 8132623
? 0 8190429
? 0 8113355
? 0 8151892
? 0 8139046
...

result:

ok Solution answered 0 ans asked 165 questions

Test #12:

score: 0
Accepted
time: 1ms
memory: 3568kb

input:

10000000 10000000 170
823709914
811797724
797981562
842436911
799153073
804760694
804724418
797161570
798000810
798393092
799537156
797271310
797615034
797249394
797222538
797542032
797287568
797157506
797200860
797281908
797229763
797171957
797191226
797166297
797165535
797204835
797174099
79715697...

output:

? 0 3333333
? 0 6666667
? 0 5555555
? 0 7777778
? 0 4814814
? 0 6296297
? 0 4320987
? 0 5308643
? 0 4979423
? 0 5637861
? 0 4759945
? 0 5198903
? 0 5052583
? 0 5345223
? 0 5247675
? 0 5442769
? 0 5182645
? 0 5312707
? 0 5269353
? 0 5356061
? 0 5240450
? 0 5298256
? 0 5278987
? 0 5317524
? 0 5304678
...

result:

ok Solution answered 493034338 ans asked 165 questions

Test #13:

score: 0
Accepted
time: 2ms
memory: 3584kb

input:

10000000 10000000 170
765056349
784106651
815809073
746898175
755809417
751720897
747773179
757744679
746954383
750084767
747906171
747334227
746879883
747919507
747003155
747139139
747133215
746873091
746959799
746901563
746844189
746959369
746882725
746882295
746856603
746907987
746848471
74687373...

output:

? 0 3333333
? 0 6666667
? 0 2222222
? 0 4444445
? 0 3703703
? 0 5185186
? 0 4691357
? 0 5679013
? 0 4362139
? 0 5020577
? 0 4142661
? 0 4581619
? 0 4435299
? 0 4727939
? 0 4337753
? 0 4532847
? 0 4272723
? 0 4402785
? 0 4359431
? 0 4446139
? 0 4417236
? 0 4475042
? 0 4397968
? 0 4436505
? 0 4423659
...

result:

ok Solution answered 471261661 ans asked 165 questions

Test #14:

score: 0
Accepted
time: 2ms
memory: 3572kb

input:

5000000 6666666 170
397777303
449350635
415472850
400362500
396630288
410119909
398188828
398742883
401306853
397091428
397823033
396813193
396847573
397377239
397172723
396650613
396739183
396867383
396883698
396594668
396691013
396674698
396610468
396738928
396605378
396653293
396633923
396596203
...

output:

? 0 2222222
? 0 4444444
? 0 1481481
? 0 2962963
? 0 2469135
? 0 3456790
? 0 2139917
? 0 2798354
? 0 1920438
? 0 2359397
? 0 2213076
? 0 2505716
? 0 2408168
? 0 2603262
? 0 2343138
? 0 2473200
? 0 2429846
? 0 2516554
? 0 2400943
? 0 2458749
? 0 2439480
? 0 2478017
? 0 2465171
? 0 2490863
? 0 2456607
...

result:

ok Solution answered 261074243 ans asked 159 questions

Test #15:

score: 0
Accepted
time: 1ms
memory: 3668kb

input:

5000000 6666666 170
486715006
449802296
448642126
467855822
456337162
447874826
447325254
451448396
449081086
447435870
446906374
448021146
447520350
447240778
446980650
447500898
446906374
447154066
447057910
446922846
446906374
446999918
446906374
446906374
446906374
446931410
446906374
446906374
...

output:

? 0 2222222
? 0 4444444
? 0 3703703
? 0 5185185
? 0 3209876
? 0 4197531
? 0 3868312
? 0 4526749
? 0 3648833
? 0 4087792
? 0 3941471
? 0 4234111
? 0 3843925
? 0 4039019
? 0 3973987
? 0 4104049
? 0 3930633
? 0 4017341
? 0 3901730
? 0 3959536
? 0 3940267
? 0 3978804
? 0 3927421
? 0 3953113
? 0 3944548
...

result:

ok Solution answered 281773788 ans asked 159 questions

Subtask #4:

score: 0
Wrong Answer

Test #16:

score: 0
Wrong Answer
time: 1ms
memory: 3608kb

input:

10000000 10000000 100
617967700
284634300
395745500
173523200
247597400
171818700
148832000
221201400
181753800
155357800
137858000
177305600
152490000
148041800
138287000
157796400
139483800
144790200
143819200
136119400
138038700
139009700
139965500
136111800
137396400
136440600
135683700
13729700...

output:

? 0 3333333
? 0 6666667
? 0 5555555
? 0 7777778
? 0 7037036
? 0 8518519
? 0 8024690
? 0 9012346
? 0 7695472
? 0 8353910
? 0 8134430
? 0 8573388
? 0 7988110
? 0 8280750
? 0 8183202
? 0 8378296
? 0 8118172
? 0 8248234
? 0 8074818
? 0 8161526
? 0 8132623
? 0 8190429
? 0 8113355
? 0 8151892
? 0 8139046
...

result:

wrong answer Query Limit Exceeded!

Subtask #5:

score: 0
Wrong Answer

Test #21:

score: 0
Wrong Answer
time: 1ms
memory: 3700kb

input:

10000000 10000000 75
617967700
284634300
395745500
173523200
247597400
171818700
148832000
221201400
181753800
155357800
137858000
177305600
152490000
148041800
138287000
157796400
139483800
144790200
143819200
136119400
138038700
139009700
139965500
136111800
137396400
136440600
135683700
137297000...

output:

? 0 3333333
? 0 6666667
? 0 5555555
? 0 7777778
? 0 7037036
? 0 8518519
? 0 8024690
? 0 9012346
? 0 7695472
? 0 8353910
? 0 8134430
? 0 8573388
? 0 7988110
? 0 8280750
? 0 8183202
? 0 8378296
? 0 8118172
? 0 8248234
? 0 8074818
? 0 8161526
? 0 8132623
? 0 8190429
? 0 8113355
? 0 8151892
? 0 8139046
...

result:

wrong answer Query Limit Exceeded!