結果

問題 No.934 Explosive energy drink
ユーザー pengin_2000pengin_2000
提出日時 2021-10-23 18:53:00
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 340 ms / 2,000 ms
コード長 701 bytes
コンパイル時間 1,312 ms
コンパイル使用メモリ 30,072 KB
実行使用メモリ 24,612 KB
平均クエリ数 709.58
最終ジャッジ日時 2023-10-26 02:13:45
合計ジャッジ時間 8,699 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
24,612 KB
testcase_01 AC 339 ms
24,612 KB
testcase_02 AC 24 ms
24,612 KB
testcase_03 AC 169 ms
24,612 KB
testcase_04 AC 340 ms
24,612 KB
testcase_05 AC 25 ms
24,612 KB
testcase_06 AC 23 ms
24,612 KB
testcase_07 AC 23 ms
24,612 KB
testcase_08 AC 24 ms
24,612 KB
testcase_09 AC 24 ms
24,612 KB
testcase_10 AC 24 ms
24,612 KB
testcase_11 AC 24 ms
24,612 KB
testcase_12 AC 26 ms
24,612 KB
testcase_13 AC 29 ms
24,612 KB
testcase_14 AC 29 ms
24,612 KB
testcase_15 AC 109 ms
24,612 KB
testcase_16 AC 40 ms
24,612 KB
testcase_17 AC 64 ms
24,612 KB
testcase_18 AC 65 ms
24,612 KB
testcase_19 AC 130 ms
24,612 KB
testcase_20 AC 219 ms
24,612 KB
testcase_21 AC 234 ms
24,612 KB
testcase_22 AC 334 ms
24,612 KB
testcase_23 AC 339 ms
24,612 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
int main()
{
	int n;
	scanf("%d", &n);
	int i, j;
	int res[1003];
	int ans;
	for (i = 0; i < n; i++)
	{
		printf("? %d\n", n - 1);
		if (i == n - 1)
		{
			for (j = 0; j < i - 1; j++)
				printf("%d ", j + 1);
			printf("%d\n", n - 1);
		}
		else
		{
			for (j = 0; j < i; j++)
				printf("%d ", j + 1);
			for (j = i + 1; j < n - 1; j++)
				printf("%d ", j + 1);
			printf("%d\n", n);
		}
		fflush(stdout);
		scanf("%d", &ans);
		res[i] = ans;
	}
	j = 0;
	for (i = 0; i < n; i++)
		if (res[i] == 0)
			j++;
	printf("! %d\n", j);
	for (i = 0; i < n; i++)
	{
		if (res[i] > 0)
			continue;
		j--;
		if (j > 0)
			printf("%d ", i + 1);
		else
			printf("%d\n", i + 1);
	}
	return 0;
}
0