結果
| 問題 |
No.2357 Guess the Function
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-06-23 21:49:04 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 536 bytes |
| コンパイル時間 | 1,951 ms |
| コンパイル使用メモリ | 194,704 KB |
| 最終ジャッジ日時 | 2025-02-15 00:53:54 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 4 WA * 6 |
ソースコード
#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