結果

問題 No.934 Explosive energy drink
ユーザー ransewhaleransewhale
提出日時 2019-11-30 06:03:51
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 331 ms / 2,000 ms
コード長 845 bytes
コンパイル時間 2,828 ms
コンパイル使用メモリ 163,604 KB
実行使用メモリ 24,312 KB
平均クエリ数 709.58
最終ジャッジ日時 2023-09-23 19:08:28
合計ジャッジ時間 6,428 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
23,376 KB
testcase_01 AC 328 ms
23,220 KB
testcase_02 AC 27 ms
23,400 KB
testcase_03 AC 167 ms
24,312 KB
testcase_04 AC 326 ms
24,240 KB
testcase_05 AC 28 ms
23,520 KB
testcase_06 AC 27 ms
24,012 KB
testcase_07 AC 28 ms
24,012 KB
testcase_08 AC 27 ms
23,832 KB
testcase_09 AC 28 ms
23,364 KB
testcase_10 AC 28 ms
24,000 KB
testcase_11 AC 28 ms
23,532 KB
testcase_12 AC 30 ms
24,000 KB
testcase_13 AC 33 ms
23,988 KB
testcase_14 AC 32 ms
23,796 KB
testcase_15 AC 111 ms
23,964 KB
testcase_16 AC 44 ms
23,640 KB
testcase_17 AC 65 ms
24,216 KB
testcase_18 AC 65 ms
23,796 KB
testcase_19 AC 129 ms
23,520 KB
testcase_20 AC 213 ms
24,024 KB
testcase_21 AC 229 ms
23,988 KB
testcase_22 AC 323 ms
23,388 KB
testcase_23 AC 331 ms
23,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const int INF = (1<<30);
const ll INFLL = (1ll<<60);
const ll MOD = (ll)(1e9+7);

#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	a = (a<MOD)?a:(a-MOD);
	b = (b<MOD)?b:(b-MOD);
	a += b;
	a = (a<MOD)?a:(a-MOD);
}

bool ans[1010];

int main(void){
	int n,i,j,m,x,cnt=0;
	scanf("%d",&n);
	for(i=1; i<=n; ++i){
		printf("? %d\n",n-1);
		m = n-1;
		for(j=1; j<=n; ++j){
			if(i!=j){
				printf("%d",j);
				--m;
				if(m){
					printf(" ");
				}
			}
		}
		printf("\n");
		fflush(stdout);
		scanf("%d",&x);
		ans[i] = (!x);
		if(ans[i]){
			++cnt;
		}
	}
	printf("! %d\n",cnt);
	for(j=1; j<=n; ++j){
		if(ans[j]){
			printf("%d",j);
			--cnt;
			if(cnt){
				printf(" ");
			}
		}
	}
	printf("\n");
	fflush(stdout);
	return 0;
}
0