結果

問題 No.2357 Guess the Function
ユーザー Kyo_s_sKyo_s_s
提出日時 2023-06-23 21:52:10
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 348 bytes
コンパイル時間 2,008 ms
コンパイル使用メモリ 197,776 KB
実行使用メモリ 24,468 KB
平均クエリ数 2.64
最終ジャッジ日時 2023-09-13 16:52:38
合計ジャッジ時間 3,286 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
23,736 KB
testcase_01 WA -
testcase_02 AC 24 ms
24,240 KB
testcase_03 WA -
testcase_04 AC 25 ms
23,604 KB
testcase_05 WA -
testcase_06 AC 26 ms
24,252 KB
testcase_07 AC 25 ms
23,628 KB
testcase_08 WA -
testcase_09 AC 25 ms
24,252 KB
testcase_10 AC 26 ms
23,820 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;


int main() {

  cout << "? 100" << endl;
  int a; cin >> a;

  cout << "? " << 100 - a - 1 << endl;
  int b; cin >> b;

  int B = b + 1;
  for (int A = 1; A < B; A++) {
    if ((100 + A) % B == a && (100 - a - 1 + A) % B == b) {
      cout << "! " << A << " " << B << endl;
      exit(0);
    }
  }
} 
0