結果
問題 | No.2502 Optimization in the Dark |
ユーザー |
![]() |
提出日時 | 2023-10-13 23:16:25 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 27 ms / 2,000 ms |
コード長 | 1,309 bytes |
コンパイル時間 | 3,017 ms |
コンパイル使用メモリ | 248,168 KB |
実行使用メモリ | 25,580 KB |
平均クエリ数 | 4.00 |
最終ジャッジ日時 | 2024-09-15 19:07:53 |
合計ジャッジ時間 | 6,427 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 43 |
ソースコード
#include <bits/stdc++.h> namespace nono { struct Init {}; void solve([[maybe_unused]] const Init& init) { int n; std::cin >> n; auto request = [](int i, int x, int j, int y) { std::cout << "? " << i << ' ' << x << ' ' << j << ' ' << y << std::endl; }; auto response = []() { std::string s; std::cin >> s; return s; }; std::vector<int> index(3); std::iota(index.begin(), index.end(), 1); request(index[0], 2 * n, index[1], 2 * n); if (response() == "No") { std::swap(index[0], index[1]); } request(index[1], 2 * n, index[2], 2 * n); if (response() == "No") { std::swap(index[1], index[2]); } request(index[0], n, index[1], n); if (response() == "Yes") { std::swap(index[0], index[1]); } std::cout << "! "; for (int i = 0; i < n; i++) { std::cout << index[0] << ' ' << index[2] << ' '; } for (int i = 0; i < n; i++) { std::cout << index[1] << ' ' << index[2] << ' '; } for (int i = 0; i < n; i++) { std::cout << index[0] << ' ' << index[1] << (i + 1 == n ? '\n' : ' '); } } } // namespace nono int main() { std::cin.tie(0)->sync_with_stdio(0); int t = 1; nono::Init init; while (t--) nono::solve(init); }