結果
| 問題 | No.2502 Optimization in the Dark |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-10-13 23:37:11 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 756 bytes |
| コンパイル時間 | 2,049 ms |
| コンパイル使用メモリ | 194,980 KB |
| 最終ジャッジ日時 | 2025-02-17 07:36:43 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge6 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 43 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:5:36: warning: ‘N’ is used uninitialized [-Wuninitialized]
5 | cout << "? 1 " << N * 2 << " 2 " << N * 2 << endl;
| ^~~~~
main.cpp:4:13: note: ‘N’ was declared here
4 | int N;
| ^
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main () {
int N;
cout << "? 1 " << N * 2 << " 2 " << N * 2 << endl;
string s;
cin >> s;
int i, j, k;
if (s == "Yes") {
cout << "? 2 " << N * 2 << " 3 " << N * 2 << endl;
string t;
cin >> t;
k = (t == "Yes" ? 3 : 2);
} else {
cout << "? 1 " << N * 2 << " 3 " << N * 2 << endl;
string t;
cin >> t;
k = (t == "Yes" ? 3 : 1);
}
i = (k + 1 > 3 ? k - 2 : k + 1), j = (k + 2 > 3 ? k - 1 : k + 2);
cout << "? " << i << " " << N << " " << j << " " << N << endl;
cin >> s;
if (s == "No") {
swap(i, j);
}
cout << "!";
for (int p = 0; p < N * 2; p ++) {
cout << " " << (p & 1 ? i : j) << " " << k;
}
for (int p = 0; p < N; p ++) {
cout << " " << i << " " << j;
}
cout<< endl;
}