QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#296968#2727. Gradient DescentCamillus#0 2ms3716kbC++201.1kb2024-01-03 20:37:142024-07-04 03:16:37

Judging History

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

  • [2024-07-04 03:16:37]
  • 评测
  • 测评结果:0
  • 用时:2ms
  • 内存:3716kb
  • [2024-01-03 20:37:14]
  • 提交

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;

    if (query(0, 0) < query(0, 1)) {
        y = 0;
    } else {
        int l = 0, r = C;
        while (r - l > 1) {
            int m = (l + r) / 2;
            if (query(0, m) < query(0, m + 1)) {
                l = m;
            } else {
                r = m;
            }
        }
        y = r;
    }

    if (query(0, 0) < query(1, 0)) {
        x = 0;
    } else {
        int l = 0, r = C;
        while (r - l > 1) {
            int m = (l + r) / 2;
            if (query(m, 0) < query(m + 1, 0)) {
                l = m;
            } else {
                r = m;
            }
        }
        x = r;
    }

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

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

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

input:

1 90 90
7500
7400
3000
2900
5300
5200
6400
6300
7000
6900
7300
7200
7400
7300
7500
7400
11800
11900
14000
14100
15100
15200
15700
15800
16000
16100
16100
16200
16200
16300
16200

output:

? 0 0
? 0 1
? 0 45
? 0 46
? 0 22
? 0 23
? 0 11
? 0 12
? 0 5
? 0 6
? 0 2
? 0 3
? 0 1
? 0 2
? 0 0
? 1 0
? 45 0
? 46 0
? 67 0
? 68 0
? 78 0
? 79 0
? 84 0
? 85 0
? 87 0
? 88 0
? 88 0
? 89 0
? 89 0
? 90 0
? 90 1
! 16200

result:

wrong answer Wrong Answer: expected 0, found 16200

Subtask #2:

score: 0
Wrong Answer

Test #6:

score: 0
Wrong Answer
time: 2ms
memory: 3708kb

input:

1 10000000 90
815667200
815667100
315667200
315667100
565667200
565667100
690667200
690667100
753167200
753167100
784417200
784417100
800042200
800042100
807854700
807854600
811761000
811760900
813714100
813714000
814690700
814690600
815179000
815178900
815423100
815423000
815545200
815545100
815606...

output:

? 0 0
? 0 1
? 0 5000000
? 0 5000001
? 0 2500000
? 0 2500001
? 0 1250000
? 0 1250001
? 0 625000
? 0 625001
? 0 312500
? 0 312501
? 0 156250
? 0 156251
? 0 78125
? 0 78126
? 0 39062
? 0 39063
? 0 19531
? 0 19532
? 0 9765
? 0 9766
? 0 4882
? 0 4883
? 0 2441
? 0 2442
? 0 1220
? 0 1221
? 0 610
? 0 611
? ...

result:

wrong answer Query Limit Exceeded!

Subtask #3:

score: 0
Wrong Answer

Test #11:

score: 0
Wrong Answer
time: 2ms
memory: 3584kb

input:

10000000 10000000 170
951301000
951300900
451301000
451300900
701301000
701300900
826301000
826300900
888801000
888800900
920051000
920050900
935676000
935675900
943488500
943488400
947394800
947394700
949347900
949347800
950324500
950324400
950812800
950812700
951056900
951056800
951179000
95117890...

output:

? 0 0
? 0 1
? 0 5000000
? 0 5000001
? 0 2500000
? 0 2500001
? 0 1250000
? 0 1250001
? 0 625000
? 0 625001
? 0 312500
? 0 312501
? 0 156250
? 0 156251
? 0 78125
? 0 78126
? 0 39062
? 0 39063
? 0 19531
? 0 19532
? 0 9765
? 0 9766
? 0 4882
? 0 4883
? 0 2441
? 0 2442
? 0 1220
? 0 1221
? 0 610
? 0 611
? ...

result:

wrong answer Wrong Answer: expected 0, found 1680033100

Subtask #4:

score: 0
Wrong Answer

Test #16:

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

input:

10000000 10000000 100
951301000
951300900
451301000
451300900
701301000
701300900
826301000
826300900
888801000
888800900
920051000
920050900
935676000
935675900
943488500
943488400
947394800
947394700
949347900
949347800
950324500
950324400
950812800
950812700
951056900
951056800
951179000
95117890...

output:

? 0 0
? 0 1
? 0 5000000
? 0 5000001
? 0 2500000
? 0 2500001
? 0 1250000
? 0 1250001
? 0 625000
? 0 625001
? 0 312500
? 0 312501
? 0 156250
? 0 156251
? 0 78125
? 0 78126
? 0 39062
? 0 39063
? 0 19531
? 0 19532
? 0 9765
? 0 9766
? 0 4882
? 0 4883
? 0 2441
? 0 2442
? 0 1220
? 0 1221
? 0 610
? 0 611
? ...

result:

wrong answer Wrong Answer: expected 0, found 1680033100

Subtask #5:

score: 0
Wrong Answer

Test #21:

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

input:

10000000 10000000 75
951301000
951300900
451301000
451300900
701301000
701300900
826301000
826300900
888801000
888800900
920051000
920050900
935676000
935675900
943488500
943488400
947394800
947394700
949347900
949347800
950324500
950324400
950812800
950812700
951056900
951056800
951179000
951178900...

output:

? 0 0
? 0 1
? 0 5000000
? 0 5000001
? 0 2500000
? 0 2500001
? 0 1250000
? 0 1250001
? 0 625000
? 0 625001
? 0 312500
? 0 312501
? 0 156250
? 0 156251
? 0 78125
? 0 78126
? 0 39062
? 0 39063
? 0 19531
? 0 19532
? 0 9765
? 0 9766
? 0 4882
? 0 4883
? 0 2441
? 0 2442
? 0 1220
? 0 1221
? 0 610
? 0 611
? ...

result:

wrong answer Query Limit Exceeded!