結果
| 問題 |
No.2502 Optimization in the Dark
|
| コンテスト | |
| ユーザー |
Rubikun
|
| 提出日時 | 2023-10-13 21:40:16 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 25 ms / 2,000 ms |
| コード長 | 2,296 bytes |
| コンパイル時間 | 1,652 ms |
| コンパイル使用メモリ | 199,152 KB |
| 最終ジャッジ日時 | 2025-02-17 07:10:37 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 43 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define mp make_pair
#define si(x) int(x.size())
const int mod=998244353,MAX=300005,INF=1<<30;
int main(){
std::ifstream in("text.txt");
std::cin.rdbuf(in.rdbuf());
cin.tie(0);
ios::sync_with_stdio(false);
int N;cin>>N;
vector<int> P(3);
cout<<"?"<<" "<<1<<" "<<2*N<<" "<<2<<" "<<2*N<<endl;
string S;cin>>S;
if(S=="Yes"){
cout<<"?"<<" "<<3<<" "<<2*N<<" "<<2<<" "<<2*N<<endl;
string SS;cin>>SS;
if(SS=="Yes"){
P[2]=2;
cout<<"?"<<" "<<1<<" "<<N<<" "<<3<<" "<<N<<endl;
string SSS;cin>>SSS;
if(SSS=="Yes"){
P[1]=3;
P[0]=1;
}else{
P[1]=1;
P[0]=3;
}
}else{
P[2]=3;
cout<<"?"<<" "<<1<<" "<<N<<" "<<2<<" "<<N<<endl;
string SSS;cin>>SSS;
if(SSS=="Yes"){
P[1]=2;
P[0]=1;
}else{
P[1]=1;
P[0]=2;
}
}
}else{
cout<<"?"<<" "<<3<<" "<<2*N<<" "<<1<<" "<<2*N<<endl;
string SS;cin>>SS;
if(SS=="Yes"){
P[2]=1;
cout<<"?"<<" "<<2<<" "<<N<<" "<<3<<" "<<N<<endl;
string SSS;cin>>SSS;
if(SSS=="Yes"){
P[1]=3;
P[0]=2;
}else{
P[1]=2;
P[0]=3;
}
}else{
P[2]=3;
cout<<"?"<<" "<<1<<" "<<N<<" "<<2<<" "<<N<<endl;
string SSS;cin>>SSS;
if(SSS=="Yes"){
P[1]=2;
P[0]=1;
}else{
P[1]=1;
P[0]=2;
}
}
}
cout<<"!";
for(int i=1;i<=N;i++) cout<<" "<<P[1]<<" "<<P[2];
for(int i=1;i<=N;i++) cout<<" "<<P[0]<<" "<<P[2];
for(int i=1;i<=N;i++) cout<<" "<<P[0]<<" "<<P[1];
cout<<endl;
return 0;
}
Rubikun