結果
問題 |
No.2357 Guess the Function
|
ユーザー |
|
提出日時 | 2023-06-23 22:08:58 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 741 bytes |
コンパイル時間 | 3,015 ms |
コンパイル使用メモリ | 158,924 KB |
最終ジャッジ日時 | 2025-02-15 01:06:15 |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 1 WA * 9 |
ソースコード
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <utility> #include <map> #include <set> #include <queue> #include <iomanip> #include <cstring> #include <atcoder/all> using namespace std; using namespace atcoder; typedef long long ll; #define rep(i,n) for (int i = 0; i < int(n);i++) int main(){ int x1,x2; cout << "? 2" << endl; cin >> x1; x1 -= 2; cout << "? 3" << endl; cin >> x2; x2 -= 3; for (int i = 2; i <= 100;i++){ int y1 = x1; int y2 = x2; while(y1 < 0) y1 += i; while(y2 < 0) y2 += i; if (y1 == y2){ cout << "! " << y1 << " " << i << endl; return 0; } } if (x1 == x2+1){ cout << "! " << 0 << " " << 1 << endl; } return 0; }