結果

問題 No.2357 Guess the Function
ユーザー i_am_noobi_am_noob
提出日時 2023-06-29 17:21:34
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 25 ms / 1,000 ms
コード長 482 bytes
コンパイル時間 1,842 ms
コンパイル使用メモリ 197,688 KB
実行使用メモリ 24,396 KB
平均クエリ数 2.91
最終ジャッジ日時 2023-09-20 12:36:34
合計ジャッジ時間 3,356 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
24,324 KB
testcase_01 AC 24 ms
23,400 KB
testcase_02 AC 24 ms
23,808 KB
testcase_03 AC 24 ms
23,544 KB
testcase_04 AC 24 ms
23,412 KB
testcase_05 AC 24 ms
23,520 KB
testcase_06 AC 24 ms
23,544 KB
testcase_07 AC 24 ms
23,508 KB
testcase_08 AC 24 ms
23,628 KB
testcase_09 AC 23 ms
24,396 KB
testcase_10 AC 24 ms
23,364 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using pii=pair<int,int>;

#define all(a) a.begin(),a.end()
#define pb push_back
#define sz(a) ((int)a.size())

signed main(){
    ios_base::sync_with_stdio(0),cin.tie(0);
    cout << "? 100" << endl;
    int x; cin >> x;
    if(x==99){
        cout << "! 99 100" << endl;
        return 0;
    }
    cout << "? " << 100-x-1 << endl;
    int b; cin >> b; b++;
    cout << "! " << (b-(100-x)%b)%b << ' ' << b << endl;
}
0