結果

問題 No.246 質問と回答
ユーザー abL8ZLsTbFabL8ZLsTbF
提出日時 2016-08-29 15:47:41
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 104 ms / 2,000 ms
コード長 439 bytes
コンパイル時間 1,897 ms
コンパイル使用メモリ 101,172 KB
実行使用メモリ 39,536 KB
平均クエリ数 30.90
最終ジャッジ日時 2023-09-23 20:18:08
合計ジャッジ時間 6,674 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 104 ms
36,836 KB
testcase_01 AC 98 ms
37,120 KB
testcase_02 AC 98 ms
37,024 KB
testcase_03 AC 99 ms
39,004 KB
testcase_04 AC 99 ms
39,080 KB
testcase_05 AC 99 ms
37,420 KB
testcase_06 AC 98 ms
37,304 KB
testcase_07 AC 100 ms
36,944 KB
testcase_08 AC 97 ms
37,588 KB
testcase_09 AC 97 ms
37,144 KB
testcase_10 AC 99 ms
34,856 KB
testcase_11 AC 99 ms
39,036 KB
testcase_12 AC 99 ms
39,184 KB
testcase_13 AC 99 ms
38,880 KB
testcase_14 AC 99 ms
36,816 KB
testcase_15 AC 95 ms
37,676 KB
testcase_16 AC 97 ms
39,536 KB
testcase_17 AC 95 ms
37,500 KB
testcase_18 AC 98 ms
36,980 KB
testcase_19 AC 98 ms
36,920 KB
testcase_20 AC 97 ms
36,844 KB
testcase_21 AC 93 ms
39,512 KB
testcase_22 AC 96 ms
37,048 KB
testcase_23 AC 95 ms
37,480 KB
testcase_24 AC 95 ms
37,528 KB
testcase_25 AC 98 ms
36,812 KB
testcase_26 AC 97 ms
36,960 KB
testcase_27 AC 97 ms
36,908 KB
testcase_28 AC 98 ms
36,868 KB
testcase_29 AC 96 ms
39,256 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 min = 1, max = (int)Math.Pow(10, 9);
		int mid = (int)Math.Ceiling((min + max) / 2.0);
		for (; min != max; mid = (int)Math.Ceiling((min + max) / 2.0))
		{
			Console.WriteLine("? {0}", mid);
			bool isLess = int.Parse(Console.ReadLine()) == 0;
			if (isLess)
			{
				max = mid - 1;
			}
			else
			{
				min = mid;
			}
		}
		Console.WriteLine("! {0}", mid);
	}
}
0