結果
| 問題 |
No.1959 Prefix MinMax
|
| コンテスト | |
| ユーザー |
trineutron
|
| 提出日時 | 2022-05-27 22:53:08 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 864 bytes |
| コンパイル時間 | 2,127 ms |
| コンパイル使用メモリ | 197,968 KB |
| 最終ジャッジ日時 | 2025-01-29 16:14:42 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 28 WA * 3 |
ソースコード
#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) = rng() % 2;
}
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