結果

問題 No.2357 Guess the Function
ユーザー luanmengleiluanmenglei
提出日時 2023-06-23 21:49:04
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 536 bytes
コンパイル時間 2,004 ms
コンパイル使用メモリ 199,048 KB
実行使用メモリ 24,384 KB
平均クエリ数 3.00
最終ジャッジ日時 2023-09-13 16:49:01
合計ジャッジ時間 3,240 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int rand(int l, int r) {
	return uniform_int_distribution<>(l, r)(rng);
}

int main() {
	int c = 1;
	cout << "? " << c << endl;
	int x, y;
	cin >> x;
	int d = rand(x - 1, 100);
	cout << "? " << d << endl;
	cin >> y;
	for (int A = 0; A <= 100; A ++) {
		for (int B = A + 1; B <= 100; B ++) {
			if ((c + A) % B == x && (d + A) % B == y) {
				cout << "! " << A << " " << B;
				return 0;
			}
		}
	}
	return 0;
}
// 7 10
0