結果
| 問題 |
No.2502 Optimization in the Dark
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-10-13 21:56:34 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 26 ms / 2,000 ms |
| コード長 | 633 bytes |
| コンパイル時間 | 1,123 ms |
| コンパイル使用メモリ | 71,940 KB |
| 実行使用メモリ | 25,484 KB |
| 平均クエリ数 | 4.00 |
| 最終ジャッジ日時 | 2024-09-15 17:37:11 |
| 合計ジャッジ時間 | 4,169 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 43 |
ソースコード
#include<iostream>
#include<vector>
#include<algorithm>
#include<cassert>
using namespace std;
int N;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
cin>>N;
int mxi=1;
for(int i=2;i<=3;i++)
{
cout<<"? "<<mxi<<" "<<2*N<<" "<<i<<" "<<2*N<<endl;
string s;cin>>s;
if(s=="Yes")mxi=i;
}
int A,B;
if(mxi==1)A=2,B=3;
else if(mxi==2)A=1,B=3;
else A=1,B=2;
cout<<"? "<<A<<" "<<N<<" "<<B<<" "<<N<<endl;
string s;cin>>s;
if(s=="Yes");
else swap(A,B);
cout<<"!";
for(int i=0;i<N;i++)cout<<" "<<B<<" "<<mxi;
for(int i=0;i<N;i++)cout<<" "<<A<<" "<<mxi;
for(int i=0;i<N;i++)cout<<" "<<A<<" "<<B;
cout<<endl;
}