結果

問題 No.1959 Prefix MinMax
ユーザー kyawakyawa
提出日時 2022-05-27 22:01:15
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 41 ms / 2,000 ms
コード長 822 bytes
コンパイル時間 2,173 ms
コンパイル使用メモリ 205,212 KB
実行使用メモリ 24,660 KB
平均クエリ数 26.72
最終ジャッジ日時 2023-10-20 20:49:33
合計ジャッジ時間 5,055 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
24,648 KB
testcase_01 AC 25 ms
24,648 KB
testcase_02 AC 24 ms
24,648 KB
testcase_03 AC 24 ms
24,648 KB
testcase_04 AC 24 ms
24,648 KB
testcase_05 AC 24 ms
24,648 KB
testcase_06 AC 25 ms
24,648 KB
testcase_07 AC 40 ms
24,648 KB
testcase_08 AC 40 ms
24,648 KB
testcase_09 AC 40 ms
24,648 KB
testcase_10 AC 40 ms
24,648 KB
testcase_11 AC 40 ms
24,648 KB
testcase_12 AC 39 ms
24,648 KB
testcase_13 AC 39 ms
24,648 KB
testcase_14 AC 40 ms
24,648 KB
testcase_15 AC 39 ms
24,648 KB
testcase_16 AC 40 ms
24,648 KB
testcase_17 AC 39 ms
24,648 KB
testcase_18 AC 39 ms
24,648 KB
testcase_19 AC 40 ms
24,648 KB
testcase_20 AC 40 ms
24,648 KB
testcase_21 AC 41 ms
24,648 KB
testcase_22 AC 40 ms
24,648 KB
testcase_23 AC 41 ms
24,648 KB
testcase_24 AC 40 ms
24,648 KB
testcase_25 AC 40 ms
24,648 KB
testcase_26 AC 39 ms
24,648 KB
testcase_27 AC 40 ms
24,648 KB
testcase_28 AC 40 ms
24,648 KB
testcase_29 AC 40 ms
24,648 KB
testcase_30 AC 40 ms
24,648 KB
testcase_31 AC 40 ms
24,660 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

int main(){
    int64_t T; cin >> T;
    while(T--){
        int64_t N; cin >> N;
        vector<int64_t> A(N), B(N);
        cout << '?';
        for(int64_t i = 0; i < N-1; i++) cout << " " << (i & 1);
        cout << endl;
        for(auto &a : A) cin >> a;
        cout << '?';
        for(int64_t i = 0; i < N-1; i++) cout << " " << ((i & 1) ^ 1);
        cout << endl;
        for(auto &b : B) cin >> b;
        cout << '!' << " " << A[0];
        for(int64_t i = 1; i < N; i++){
            if(A[i-1] != A[i]){
                cout << " " << A[i];
                continue;
            }
            if(B[i-1] != B[i]){
                cout << " " << B[i];
                continue;
            }
            cout << " " << A[i];
        }
        cout << endl;
    }
}
0