結果

問題 No.2357 Guess the Function
ユーザー jabeejabee
提出日時 2023-06-23 22:59:23
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,775 bytes
コンパイル時間 4,483 ms
コンパイル使用メモリ 259,664 KB
実行使用メモリ 24,420 KB
平均クエリ数 2.91
最終ジャッジ日時 2023-09-13 18:07:01
合計ジャッジ時間 6,003 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
23,976 KB
testcase_01 AC 26 ms
24,084 KB
testcase_02 AC 27 ms
23,568 KB
testcase_03 WA -
testcase_04 AC 26 ms
24,420 KB
testcase_05 AC 26 ms
24,180 KB
testcase_06 AC 26 ms
23,556 KB
testcase_07 AC 26 ms
24,264 KB
testcase_08 AC 25 ms
23,976 KB
testcase_09 AC 26 ms
23,664 KB
testcase_10 AC 26 ms
23,760 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#include <math.h>
#include <algorithm>
#include <iostream>
#include <vector>
#include <atcoder/all>
#include <atcoder/dsu>
#include <atcoder/segtree>
#include <atcoder/lazysegtree>
#include <atcoder/modint>
#include <atcoder/scc>
#include <chrono>
#include <random>
#include <cassert>
#ifndef templete
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
 
//#include<boost/multiprecision/cpp_int.hpp>
//using namespace boost::multiprecision;
using namespace std;
using namespace atcoder;
//using atmint = modint998244353;
using atmint = modint;
using Graph = vector<vector<int>>;
using P = pair<long long,long long>;
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
 
//---------------------------------------------------------------------------------------------------

#endif // templete
//---------------------------------------------------------------------------------------------------
void _main() {   
    ll x1 = 100;
    cout << "? " << x1 << endl;
    ll ans1;
    cin >> ans1;
    ll x2 = x1;
    ll v = ans1;
    while(v != -1){
        x2--;
        v--;
    }
    cout << "? " << x2 << endl;
    ll ans2;
    cin >> ans2;
    rep(a,0,100)rep(b,a+1,101){
        if((a+x1)%b == ans1 && (a+x2)%b == ans2){
            cout << "! " << a << " " << b << endl;
            return;
        }
    }
}
0