結果

問題 No.2357 Guess the Function
コンテスト
ユーザー erbowl
提出日時 2023-06-26 20:34:02
言語 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  
実行時間 17 ms / 1,000 ms
コード長 555 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,142 ms
コンパイル使用メモリ 209,064 KB
実行使用メモリ 29,776 KB
平均クエリ数 2.91
最終ジャッジ日時 2026-07-01 12:38:37
合計ジャッジ時間 2,430 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

typedef long long ll;
typedef long double ld;
#include <bits/stdc++.h>
using namespace std;
#define int long long

signed main(){
    std::cout << "? 100" << std::endl;
    ll x1;
    std::cin >> x1;
    if(x1==99){
        std::cout << "! 99 100" << std::endl;
        return 0;
    }
    std::cout << "? "<<100-x1-1<< std::endl;
    ll x2;
    std::cin >> x2;
    ll b = x2+1;
    for (int i = 0; i < b; i++) {
        if((i+100)%b==x1&&(i+100-x1-1)%b==x2){
            std::cout << "! "<<i<<" "<<b << std::endl;
            return 0;
        }
    }
}
0