結果
| 問題 |
No.2357 Guess the Function
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-06-23 23:35:03 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 599 bytes |
| コンパイル時間 | 1,583 ms |
| コンパイル使用メモリ | 165,416 KB |
| 実行使用メモリ | 25,604 KB |
| 平均クエリ数 | 2.91 |
| 最終ジャッジ日時 | 2024-07-01 03:22:26 |
| 合計ジャッジ時間 | 2,780 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 9 WA * 1 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int a, b;
cout << "? 100" << endl;
cin >> a;
if(a == 99){
cout << 99 << ' ' << 100 << endl;
return 0;
}
cout << "? " << 100 - a - 1 << endl;
cin >> b;
//(x + 100) % (b + 1) == a
//(x + 100 - a - 1) % (b + 1) == b
int B = b + 1;
for(int A = 0; A < 99; A++){
if((A + 100) % B == a && (A + 100 - a - 1) % B == b){
cout << "! " << A << ' ' << B << endl;
return 0;
}
}
}