結果
| 問題 |
No.2357 Guess the Function
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-06-23 22:41:32 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 856 bytes |
| コンパイル時間 | 1,866 ms |
| コンパイル使用メモリ | 192,328 KB |
| 最終ジャッジ日時 | 2025-02-15 01:21:36 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 1 |
| other | RE * 10 |
ソースコード
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
// #include <atcoder/all>
// using namespace atcoder;
using ll = long long;
#define rep(i,n) for (ll i = 0; i < (n); ++i)
using vl = vector<ll>;
using vvl = vector<vl>;
using P = pair<ll,ll>;
#define pb push_back
#define int long long
#define double long double
#define INF (ll) 3e18
// Ctrl + Shift + B コンパイル
// Ctrl + C 中断
// ./m 実行
signed main(){
int a = -1;
int b = -1;
int x1 = 1000;
int x2 = -1;
int y1 = -1;
int y2 = -1;
cout << "? " << x1 << endl;
cin >> y1;
x2 = x1 - y1-1;
cout << "? " << x2 << endl;
cin >> y2;
b = y2 + 1;
a = b-1 - (x2 % b);
cout << "! " << a << " " << b << endl;
}
// (A + x) % B = y
// (A + x) % B = y
// A = 13 B = 97
// x1 = 1000
// 1013 % 97 = 43
// x2 = 956
// (956+13) % 97 = 96
// a = b-1 - x2%b