結果

問題 No.934 Explosive energy drink
ユーザー pengin_2000
提出日時 2021-10-23 18:53:00
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 336 ms / 2,000 ms
コード長 701 bytes
コンパイル時間 345 ms
コンパイル使用メモリ 30,208 KB
実行使用メモリ 25,220 KB
平均クエリ数 709.58
最終ジャッジ日時 2024-09-25 10:17:56
合計ジャッジ時間 6,407 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

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