結果
問題 | No.2357 Guess the Function |
ユーザー |
![]() |
提出日時 | 2023-06-23 23:02:51 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,804 bytes |
コンパイル時間 | 3,802 ms |
コンパイル使用メモリ | 251,392 KB |
最終ジャッジ日時 | 2025-02-15 01:28:22 |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 2 TLE * 1 -- * 7 |
ソースコード
#include<bits/stdc++.h> #include <math.h> #include <algorithm> #include <iostream> #include <vector> #include <atcoder/all> #include <atcoder/dsu> #include <atcoder/segtree> #include <atcoder/lazysegtree> #include <atcoder/modint> #include <atcoder/scc> #include <chrono> #include <random> #include <cassert> #ifndef templete #define rep(i,a,b) for(int i=a;i<b;i++) #define rrep(i,a,b) for(int i=a;i>=b;i--) #define fore(i,a) for(auto &i:a) #define all(x) (x).begin(),(x).end() //#include<boost/multiprecision/cpp_int.hpp> //using namespace boost::multiprecision; using namespace std; using namespace atcoder; //using atmint = modint998244353; using atmint = modint; using Graph = vector<vector<int>>; using P = pair<long long,long long>; //#pragma GCC optimize ("-O3") using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); } typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60; template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; } template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; } //--------------------------------------------------------------------------------------------------- #endif // templete //--------------------------------------------------------------------------------------------------- void _main() { ll x1 = 100; cout << "? " << x1 << endl; ll ans1; cin >> ans1; ll x2 = x1; ll v = ans1; while(v != -1){ x2--; v--; } cout << "? " << x2 << endl; ll ans2; cin >> ans2; rep(a,0,100)rep(b,a+1,101){ if((a+x1)%b == ans1 && (a+x2)%b == ans2){ cout << "! " << a << " " << b << endl; return; } } while(1){ } }