結果
問題 |
No.2357 Guess the Function
|
ユーザー |
|
提出日時 | 2023-06-23 23:01:53 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 617 bytes |
コンパイル時間 | 1,750 ms |
コンパイル使用メモリ | 173,176 KB |
実行使用メモリ | 25,604 KB |
平均クエリ数 | 3.00 |
最終ジャッジ日時 | 2024-07-01 02:48:18 |
合計ジャッジ時間 | 2,989 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 2 WA * 8 |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll=long long; using P=pair<ll,ll>; int main(){ ll x1=25,x2=4; cout<<'?'<<" "<<x1<<endl; ll r1; cin>>r1; cout<<'?'<<" "<<x2<<endl; ll r2; cin>>r2; set<P> st; for(ll b=0;b<=100;b++){ for(ll a=0;a<b;a++){ if((x1+a-r1)%b==0&&(x2+a-r2)%b==0){ if((x1+a-r1)>=0&&(x2+a-r2)>=0){ st.insert(P(a,b)); } } } } for(auto u:st){ if(u.second!=1){ cout<<'!'<<" "<<u.first<<" "<<u.second<<endl; exit(0); } } for(auto u:st){ cout<<'!'<<" "<<u.first<<" "<<u.second<<endl; exit(0); } }