結果
| 問題 |
No.2357 Guess the Function
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-06-23 22:01:07 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,117 bytes |
| コンパイル時間 | 811 ms |
| コンパイル使用メモリ | 85,144 KB |
| 実行使用メモリ | 25,604 KB |
| 平均クエリ数 | 3.00 |
| 最終ジャッジ日時 | 2024-07-01 01:38:26 |
| 合計ジャッジ時間 | 1,971 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | WA * 10 |
ソースコード
#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(){
vector<ll> x(2),y(2);
x[0]=53;
x[1]=55;
for(int t=0;t<2;t++){
cout<<"? "<<x[t]<<endl;
std::fflush(stdout);
std::fflush(stdin);
cin>>y[t];
}
for(int a=0;a<100;a++){
for(int b=a+1;b<=100;b++){
vector<int> c(2);
int cnt=0;
for(int t=0;t<2;t++){
c[t]=y[t]-x[t];
c[t]%=b;
if(c[t]<0){
c[t]+=b;
c[t]%=b;
}
c[t]%=b;
if(a%b==c[t]){
cnt++;
}
}
if(cnt==2){
cout<<"! "<<a<<' '<<b<<endl;
std::fflush(stdout);
return 0;
}
}
}
}