結果
問題 |
No.2357 Guess the Function
|
ユーザー |
|
提出日時 | 2023-06-25 23:53:46 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 851 bytes |
コンパイル時間 | 657 ms |
コンパイル使用メモリ | 81,976 KB |
実行使用メモリ | 25,476 KB |
平均クエリ数 | 2.73 |
最終ジャッジ日時 | 2024-07-02 16:59:45 |
合計ジャッジ時間 | 2,166 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 6 WA * 1 RE * 3 |
コンパイルメッセージ
main.cpp: In function 'int main()': main.cpp:53:21: warning: 'A' may be used uninitialized [-Wmaybe-uninitialized] 53 | cout<<"! "<<A<<' '<<B<<endl; | ^~~ main.cpp:29:9: note: 'A' was declared here 29 | int A,B; | ^
ソースコード
#include<iostream> #include<set> #include<algorithm> #include<vector> #include<string> #include<set> #include<map> #include<numeric> #include<queue> #include<cmath> using namespace std; typedef long long ll; const ll INF=1LL<<60; typedef pair<int,int> P; typedef pair<int,P> PP; const ll MOD=1e9+7; int main(){ int x0=100; cout<<"? "<<x0<<endl; int a0,a1; cin>>a0; int x1=100-a0-1; cout<<"? "<<x1<<endl; cin>>a1;//f(100-a0-1)=B-1 int A,B; if(a0==99){ A=99; B=100; }else{ B=(a1+1)%100; for(int a=0;a<=100;a++){ /* if((x1+a)%B==B-1){ A=a; break; } */ if((x0+a)%B==a0){ A=a; break; } } } cout<<"! "<<A<<' '<<B<<endl; }