結果
| 問題 |
No.2357 Guess the Function
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-06-23 21:34:27 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,082 bytes |
| コンパイル時間 | 779 ms |
| コンパイル使用メモリ | 74,304 KB |
| 実行使用メモリ | 25,592 KB |
| 平均クエリ数 | 3.00 |
| 最終ジャッジ日時 | 2024-07-01 01:09:48 |
| 合計ジャッジ時間 | 1,932 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | WA * 10 |
ソースコード
#include<iostream>
#include<vector>
#include<algorithm>
#include<cassert>
using namespace std;
vector<pair<int,int> >AB[100];
int vis[100];
int X2[100];
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int tm=0;
for(int x1=1;x1<=100;x1++)
{
for(int i=0;i<100;i++)AB[i].clear();
for(int A=0;A<100;A++)for(int B=A+1;B<=100;B++)
{
int t=(A+x1)%B;
AB[t].push_back(make_pair(A,B));
}
bool out=false;
for(int i=0;i<100;i++)
{
bool fn=false;
for(int x2=1;x2<=100;x2++)
{
++tm;
bool same=false;
for(pair<int,int>p:AB[i])
{
int A=p.first,B=p.second;
int t=(A+x2)%B;
if(vis[t]==tm)
{
same=true;
break;
}
vis[t]=tm;
}
if(!same)
{
fn=true;
X2[i]=x2;
break;
}
}
if(!fn)
{
out=true;
break;
}
}
if(!out)
{
cout<<x1<<endl;
int i;cin>>i;
cout<<X2[i]<<endl;
int y;cin>>y;
for(pair<int,int>p:AB[i])
{
int A=p.first,B=p.second;
if((A+X2[i])%B==y)
{
cout<<A<<" "<<B<<endl;
return 0;
}
}
}
}
}