結果

問題 No.2357 Guess the Function
ユーザー erbowlerbowl
提出日時 2023-06-26 20:34:02
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 26 ms / 1,000 ms
コード長 555 bytes
コンパイル時間 1,978 ms
コンパイル使用メモリ 197,628 KB
実行使用メモリ 24,324 KB
平均クエリ数 2.91
最終ジャッジ日時 2023-09-16 15:24:01
合計ジャッジ時間 2,999 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
24,312 KB
testcase_01 AC 23 ms
23,484 KB
testcase_02 AC 24 ms
24,324 KB
testcase_03 AC 25 ms
23,652 KB
testcase_04 AC 23 ms
23,556 KB
testcase_05 AC 24 ms
23,676 KB
testcase_06 AC 23 ms
23,760 KB
testcase_07 AC 23 ms
23,940 KB
testcase_08 AC 24 ms
23,676 KB
testcase_09 AC 24 ms
24,228 KB
testcase_10 AC 24 ms
23,436 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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