結果

問題 No.1959 Prefix MinMax
ユーザー 沙耶花沙耶花
提出日時 2022-05-27 21:35:38
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 685 bytes
コンパイル時間 4,346 ms
コンパイル使用メモリ 263,424 KB
実行使用メモリ 24,660 KB
平均クエリ数 26.72
最終ジャッジ日時 2023-10-20 20:48:41
合計ジャッジ時間 6,861 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <stdio.h>
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using mint = modint998244353;
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf 1000000001

void solve(){
	
	int n;
	cin>>n;
	vector<int> ans(n);
	rep(i,2){
		vector<int> a(n-1);
		rep(j,n-1){
			if(j%2==i)a[j] = 0;
			else a[j]= 1;
		}
		cout<<"?";
		rep(j,n-1){
			cout<<' ';
			cout<<a[j];
		}
		cout<<endl;
		vector<int> ret(n);
		rep(j,n)cin>>ret[j];
		rep(j,n){
			if(j==0 || ret[j]!=ret[j-1])ans[j] = ret[j];
		}
	}
	cout<<"!";
	rep(j,n){
		cout<<' '<<ans[j];
	}
	cout<<endl;
	
}

int main(){
	
	int _t;
	cin>>_t;
	rep(_,_t){
		solve();
	}
	
	
	return 0;
}
0