結果

問題 No.2357 Guess the Function
ユーザー srjywrdnprktsrjywrdnprkt
提出日時 2023-06-29 19:31:28
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 27 ms / 1,000 ms
コード長 397 bytes
コンパイル時間 1,970 ms
コンパイル使用メモリ 197,908 KB
実行使用メモリ 24,276 KB
平均クエリ数 2.91
最終ジャッジ日時 2023-09-20 14:36:33
合計ジャッジ時間 3,738 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
24,024 KB
testcase_01 AC 25 ms
23,640 KB
testcase_02 AC 25 ms
23,640 KB
testcase_03 AC 25 ms
24,048 KB
testcase_04 AC 27 ms
24,276 KB
testcase_05 AC 25 ms
23,568 KB
testcase_06 AC 26 ms
24,276 KB
testcase_07 AC 25 ms
24,048 KB
testcase_08 AC 24 ms
24,048 KB
testcase_09 AC 25 ms
23,388 KB
testcase_10 AC 25 ms
23,856 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

void qry(int x){
    cout << "? " << x << endl;
}

void ans(int a, int b){
    cout << "! " << a << " " << b << endl;
    exit(0);
}

int main(){

    int x, y, a, b;
    qry(100);
    cin >> x;
    if (x == 99) ans(99, 100);
    qry(99-x);
    cin >> y;
    b = y+1;
    a = ((x-100)%b+b) % b;
    ans(a, b);

    return 0;
}
0