結果

問題 No.1187 皇帝ペンギン
ユーザー pengin_2000pengin_2000
提出日時 2021-09-06 15:44:50
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 25 ms / 1,000 ms
コード長 438 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 27,808 KB
実行使用メモリ 24,384 KB
平均クエリ数 16.48
最終ジャッジ日時 2023-08-24 05:34:09
合計ジャッジ時間 5,545 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
23,400 KB
testcase_01 AC 23 ms
24,192 KB
testcase_02 AC 23 ms
24,036 KB
testcase_03 AC 23 ms
23,832 KB
testcase_04 AC 24 ms
23,412 KB
testcase_05 AC 24 ms
23,664 KB
testcase_06 AC 24 ms
24,384 KB
testcase_07 AC 24 ms
24,036 KB
testcase_08 AC 24 ms
24,300 KB
testcase_09 AC 24 ms
24,348 KB
testcase_10 AC 23 ms
23,400 KB
testcase_11 AC 25 ms
24,372 KB
testcase_12 AC 24 ms
23,844 KB
testcase_13 AC 23 ms
23,556 KB
testcase_14 AC 23 ms
23,580 KB
testcase_15 AC 23 ms
23,412 KB
testcase_16 AC 25 ms
23,544 KB
testcase_17 AC 23 ms
24,036 KB
testcase_18 AC 24 ms
23,568 KB
testcase_19 AC 23 ms
24,384 KB
testcase_20 AC 24 ms
23,964 KB
testcase_21 AC 24 ms
23,700 KB
testcase_22 AC 25 ms
23,628 KB
testcase_23 AC 24 ms
24,024 KB
testcase_24 AC 24 ms
23,400 KB
testcase_25 AC 24 ms
24,036 KB
testcase_26 AC 23 ms
24,036 KB
testcase_27 AC 24 ms
23,640 KB
testcase_28 AC 24 ms
24,264 KB
testcase_29 AC 23 ms
24,336 KB
testcase_30 AC 24 ms
23,376 KB
testcase_31 AC 24 ms
23,628 KB
testcase_32 AC 24 ms
23,964 KB
testcase_33 AC 23 ms
24,036 KB
testcase_34 AC 24 ms
23,400 KB
testcase_35 AC 23 ms
24,348 KB
testcase_36 AC 23 ms
23,532 KB
testcase_37 AC 23 ms
23,412 KB
testcase_38 AC 24 ms
24,252 KB
testcase_39 AC 23 ms
24,264 KB
testcase_40 AC 24 ms
23,412 KB
testcase_41 AC 23 ms
23,436 KB
testcase_42 AC 23 ms
23,400 KB
testcase_43 AC 23 ms
23,652 KB
testcase_44 AC 23 ms
24,024 KB
testcase_45 AC 23 ms
23,676 KB
testcase_46 AC 23 ms
23,376 KB
testcase_47 AC 25 ms
23,412 KB
testcase_48 AC 24 ms
23,640 KB
testcase_49 AC 25 ms
23,676 KB
testcase_50 AC 25 ms
24,192 KB
testcase_51 AC 23 ms
23,424 KB
testcase_52 AC 24 ms
23,424 KB
testcase_53 AC 22 ms
24,036 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
int main()
{
	int min, mid, max;
	min = 0;
	max = 1003;
	char res1[8], res2[8];
	while (max - min > 1)
	{
		mid = (max + min) / 2;
		printf("? %d\n", mid);
		fflush(stdout);
		scanf("%s", res1);
		if (res1[0] == 's')
		{
			min = mid;
			continue;
		}
		printf("? %d\n", mid + 1);
		fflush(stdout);
		scanf("%s", res2);
		if (res2[0] == 's')
			min = mid + 1;
		else
			max = mid;
	}
	printf("! %d\n", min);
	return 0;
}
0