結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 103 ms
37,516 KB
testcase_01 AC 98 ms
37,336 KB
testcase_02 AC 98 ms
37,056 KB
testcase_03 AC 100 ms
38,952 KB
testcase_04 AC 100 ms
39,248 KB
testcase_05 AC 96 ms
39,484 KB
testcase_06 AC 98 ms
37,268 KB
testcase_07 AC 100 ms
37,268 KB
testcase_08 AC 99 ms
37,068 KB
testcase_09 AC 99 ms
39,052 KB
testcase_10 AC 100 ms
37,480 KB
testcase_11 AC 99 ms
36,892 KB
testcase_12 AC 99 ms
37,484 KB
testcase_13 AC 97 ms
37,304 KB
testcase_14 AC 97 ms
37,364 KB
testcase_15 AC 96 ms
36,828 KB
testcase_16 AC 96 ms
36,996 KB
testcase_17 AC 97 ms
37,308 KB
testcase_18 AC 96 ms
37,044 KB
testcase_19 AC 97 ms
37,256 KB
testcase_20 AC 97 ms
39,380 KB
testcase_21 AC 97 ms
37,316 KB
testcase_22 AC 96 ms
37,380 KB
testcase_23 AC 96 ms
37,632 KB
testcase_24 AC 99 ms
37,464 KB
testcase_25 AC 100 ms
36,944 KB
testcase_26 AC 98 ms
37,016 KB
testcase_27 AC 94 ms
37,604 KB
testcase_28 AC 102 ms
37,044 KB
testcase_29 AC 98 ms
35,576 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 = 0, 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