結果
問題 | No.2502 Optimization in the Dark |
ユーザー |
![]() |
提出日時 | 2023-10-13 22:40:48 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,291 bytes |
コンパイル時間 | 1,618 ms |
コンパイル使用メモリ | 171,248 KB |
実行使用メモリ | 25,580 KB |
平均クエリ数 | 4.00 |
最終ジャッジ日時 | 2024-09-15 18:25:06 |
合計ジャッジ時間 | 5,049 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 43 |
ソースコード
#include <bits/stdc++.h>using namespace std;typedef long long int ll;typedef pair<ll,ll> P;typedef vector<ll> VI;typedef vector<VI> VVI;#define REP(i,n) for(int i=0;i<(n);i++)#define ALL(v) v.begin(),v.end()template<typename T> bool chmax(T& x, const T& y){return (x<y)?(x=y,true):false;};template<typename T> bool chmin(T& x, const T& y){return (x>y)?(x=y,true):false;};constexpr ll MOD=998244353;constexpr ll INF=2e18;bool ask(int i, int x, int j, int y){cout << "? ";cout << i+1 << " " << x+1 << " ";cout << j+1 << " " << y+1 << endl;string ret;cin >> ret;return ret=="Yes";}int main(){int n; cin >> n;int mx=0;for(int i=1;i<=2;i++){if(ask(mx,n*2-1,i,n*2-1))mx=i;}int l=-1, r=-1;REP(i,3){if(i==mx)continue;if(l==-1)l=i;elser=i;}if(ask(r,n-1,l,n-1))swap(l,r);VI ansl, ansr;REP(i,n){ansl.push_back(mx);if(i%2==0)ansr.push_back(r);elseansr.push_back(l);}REP(i,n){ansl.push_back(l);ansr.push_back(r);}cout << "!";REP(i,n*2) cout << " " << ansl[i]+1 << " " << ansr[i]+1;cout << endl;return 0;}