結果

問題 No.1959 Prefix MinMax
ユーザー hourenhouren
提出日時 2022-05-27 22:14:53
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 37 ms / 2,000 ms
コード長 1,064 bytes
コンパイル時間 1,668 ms
コンパイル使用メモリ 168,844 KB
実行使用メモリ 24,540 KB
平均クエリ数 26.72
最終ジャッジ日時 2023-10-20 21:19:58
合計ジャッジ時間 4,530 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
#define fix(x) fixed << setprecision(x)
#define asc(x) x, vector<x>, greater<x>
#define rep(i, n) for(ll i = 0; i < n; i++)
#define all(x) (x).begin(),(x).end()
template<class T>bool chmin(T&a, const T&b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool chmax(T&a, const T&b){if(a<b){a=b;return 1;}return 0;}

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int t;
    cin >> t;
    rep(houren,t){
        int n, x = 1, pre, res;
        cin >> n;
        vector<int> ans(n);
        rep(i,2){
            cout << "? ";
            rep(j,n-1) cout << ((j^i)&1) << " ";
            cout << '\n' << flush;
            rep(i,n){
                cin >> res;
                if(!i) ans[i] = res;
                else{
                    if(pre!=res) ans[i] = res;
                }
                pre = res;
            }
        }
        cout << "! ";
        rep(i,n) cout << ans[i] << " ";
        cout << '\n' << flush;
    }
    return 0;
}
0