結果

問題 No.246 質問と回答
ユーザー abL8ZLsTbFabL8ZLsTbF
提出日時 2017-02-04 14:22:15
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 383 bytes
コンパイル時間 2,120 ms
コンパイル使用メモリ 99,588 KB
実行使用メモリ 40,524 KB
平均クエリ数 72.80
最終ジャッジ日時 2023-09-23 12:42:57
合計ジャッジ時間 6,939 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 101 ms
36,684 KB
testcase_01 WA -
testcase_02 AC 101 ms
38,692 KB
testcase_03 AC 99 ms
38,900 KB
testcase_04 AC 97 ms
34,364 KB
testcase_05 WA -
testcase_06 AC 97 ms
38,644 KB
testcase_07 AC 101 ms
36,824 KB
testcase_08 AC 102 ms
36,988 KB
testcase_09 WA -
testcase_10 AC 99 ms
38,772 KB
testcase_11 WA -
testcase_12 AC 97 ms
36,324 KB
testcase_13 AC 98 ms
38,536 KB
testcase_14 AC 97 ms
36,820 KB
testcase_15 WA -
testcase_16 AC 98 ms
36,976 KB
testcase_17 AC 100 ms
36,964 KB
testcase_18 AC 96 ms
36,752 KB
testcase_19 AC 99 ms
36,752 KB
testcase_20 AC 101 ms
38,368 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 99 ms
36,924 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 96 ms
36,752 KB
testcase_29 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;
		for (int i = 0; max != min && i < 100; i++)
		{
			int mid = (max + min) / 2;
			Console.WriteLine($"? {mid}");
			int result = int.Parse(Console.ReadLine());
			if (result == 1)
			{
				min = mid;
			}
			else
			{
				max = mid - 1;
			}
		}
		Console.WriteLine($"! {max}");
	}
}
0