結果
問題 |
No.2502 Optimization in the Dark
|
ユーザー |
|
提出日時 | 2023-11-05 01:31:01 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 28 ms / 2,000 ms |
コード長 | 856 bytes |
コンパイル時間 | 2,590 ms |
コンパイル使用メモリ | 194,756 KB |
最終ジャッジ日時 | 2025-02-17 19:20:29 |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 43 |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll=long long; using pii=pair<int,int>; #define all(a) a.begin(),a.end() #define pb push_back #define sz(a) ((int)a.size()) signed main(){ ios_base::sync_with_stdio(0),cin.tie(0); int n; cin >> n; int id=1,id2,id3; for(int i: {2,3}){ cout << "? " << id << ' ' << 2*n << ' ' << i << ' ' << 2*n << endl; string s; cin >> s; if(s=="Yes") id=i; } id2=id+1; if(id2>3) id2-=3; id3=id2+1; if(id3>3) id3-=3; cout << "? " << id2 << ' ' << n << ' ' << id3 << ' ' << n << endl; string s; cin >> s; if(s=="No") swap(id2,id3); cout << "! "; for(int i=0; i<n; ++i) cout << id << ' ' << id3 << ' '; for(int i=0; i<n; ++i) cout << id << ' ' << id2 << ' '; for(int i=0; i<n; ++i) cout << id2 << ' ' << id3 << ' '; cout << endl; }