結果
| 問題 | No.1959 Prefix MinMax |
| コンテスト | |
| ユーザー |
trineutron
|
| 提出日時 | 2022-05-27 23:02:44 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
RE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 865 bytes |
| 記録 | |
| コンパイル時間 | 1,311 ms |
| コンパイル使用メモリ | 213,440 KB |
| 実行使用メモリ | 30,020 KB |
| 平均クエリ数 | 94.88 |
| 最終ジャッジ日時 | 2026-06-26 06:47:02 |
| 合計ジャッジ時間 | 4,860 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 30 RE * 1 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
random_device rng_seed;
mt19937_64 rng(rng_seed());
void solve() {
int n;
cin >> n;
vector<int> a(n - 1), b(n);
for (int i = 0; i < n - 1; i++) {
a.at(i) = i % 2 == 0;
}
for (int i = 0; i < 10; i++) {
cout << "?";
for (int j = 0; j < n - 1; j++) {
cout << " " << a.at(j);
}
cout << endl;
for (int j = 0; j < n; j++) {
cin >> b.at(j);
}
for (int j = 0; j < n - 1; j++) {
if (b.at(j) == b.at(j + 1)) {
a.at(j) = 1 - a.at(j);
}
}
}
cout << "!";
for (int i = 0; i < n; i++) {
cout << " " << b.at(i);
}
cout << endl;
}
int main() {
int t;
cin >> t;
for (int i = 0; i < t; i++) {
solve();
}
return 0;
}
trineutron