結果

問題 No.2357 Guess the Function
コンテスト
ユーザー i_am_noob
提出日時 2023-06-29 17:21:34
言語 C++17
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 16 ms / 1,000 ms
コード長 482 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,221 ms
コンパイル使用メモリ 208,420 KB
実行使用メモリ 29,648 KB
平均クエリ数 2.91
最終ジャッジ日時 2026-07-01 13:04:55
合計ジャッジ時間 2,551 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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