結果

問題 No.246 質問と回答
ユーザー abL8ZLsTbFabL8ZLsTbF
提出日時 2016-08-29 15:46:30
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 102 ms / 2,000 ms
コード長 442 bytes
コンパイル時間 2,815 ms
コンパイル使用メモリ 95,288 KB
実行使用メモリ 39,596 KB
平均クエリ数 30.90
最終ジャッジ日時 2023-09-23 20:17:37
合計ジャッジ時間 7,869 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 102 ms
37,484 KB
testcase_01 AC 99 ms
38,936 KB
testcase_02 AC 101 ms
39,128 KB
testcase_03 AC 100 ms
38,748 KB
testcase_04 AC 99 ms
37,072 KB
testcase_05 AC 100 ms
35,452 KB
testcase_06 AC 99 ms
37,012 KB
testcase_07 AC 100 ms
39,424 KB
testcase_08 AC 100 ms
38,840 KB
testcase_09 AC 98 ms
35,480 KB
testcase_10 AC 98 ms
37,052 KB
testcase_11 AC 99 ms
37,564 KB
testcase_12 AC 99 ms
39,216 KB
testcase_13 AC 101 ms
37,504 KB
testcase_14 AC 101 ms
36,988 KB
testcase_15 AC 101 ms
39,248 KB
testcase_16 AC 99 ms
38,992 KB
testcase_17 AC 100 ms
39,596 KB
testcase_18 AC 100 ms
35,328 KB
testcase_19 AC 98 ms
37,208 KB
testcase_20 AC 99 ms
39,296 KB
testcase_21 AC 99 ms
38,912 KB
testcase_22 AC 99 ms
37,456 KB
testcase_23 AC 100 ms
36,860 KB
testcase_24 AC 98 ms
37,468 KB
testcase_25 AC 97 ms
34,832 KB
testcase_26 AC 101 ms
37,684 KB
testcase_27 AC 100 ms
39,288 KB
testcase_28 AC 100 ms
39,148 KB
testcase_29 AC 99 ms
36,716 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;
		for (mid = (int)Math.Ceiling((min + max) / 2.0); 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