結果

問題 No.246 質問と回答
ユーザー abL8ZLsTbFabL8ZLsTbF
提出日時 2017-02-04 14:23:58
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 405 bytes
コンパイル時間 2,799 ms
コンパイル使用メモリ 101,584 KB
実行使用メモリ 39,192 KB
平均クエリ数 72.80
最終ジャッジ日時 2023-09-23 12:42:44
合計ジャッジ時間 7,952 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 104 ms
38,852 KB
testcase_01 AC 97 ms
38,796 KB
testcase_02 WA -
testcase_03 AC 98 ms
34,312 KB
testcase_04 AC 98 ms
36,420 KB
testcase_05 AC 100 ms
34,844 KB
testcase_06 AC 97 ms
36,888 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 101 ms
37,016 KB
testcase_10 AC 97 ms
36,952 KB
testcase_11 AC 102 ms
36,620 KB
testcase_12 AC 99 ms
36,608 KB
testcase_13 AC 97 ms
34,672 KB
testcase_14 AC 99 ms
36,880 KB
testcase_15 AC 101 ms
36,728 KB
testcase_16 AC 96 ms
36,776 KB
testcase_17 WA -
testcase_18 AC 98 ms
34,956 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 100 ms
36,340 KB
testcase_22 AC 101 ms
34,836 KB
testcase_23 AC 98 ms
39,192 KB
testcase_24 AC 101 ms
38,632 KB
testcase_25 AC 102 ms
38,888 KB
testcase_26 AC 102 ms
38,868 KB
testcase_27 AC 102 ms
34,492 KB
testcase_28 AC 98 ms
36,840 KB
testcase_29 AC 101 ms
39,092 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

public class Program
{
	public static void Main()
	{
		int max = (int)1e9, min = 1;
		int mid = (max + min) / 2;
		for (int i = 0; max != min && i < 100; i++, mid = (max + min) / 2)
		{
			Console.WriteLine($"? {mid}");
			int result = int.Parse(Console.ReadLine());
			if (result == 1)
			{
				min = mid;
			}
			else
			{
				max = mid - 1;
			}
		}
		Console.WriteLine($"! {mid}");
	}
}
0