結果

問題 No.246 質問と回答
ユーザー kmtrc130kmtrc130
提出日時 2017-06-07 08:46:45
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 102 ms / 2,000 ms
コード長 652 bytes
コンパイル時間 1,945 ms
コンパイル使用メモリ 101,092 KB
実行使用メモリ 39,572 KB
平均クエリ数 30.87
最終ジャッジ日時 2023-09-23 20:23:41
合計ジャッジ時間 6,715 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 100 ms
37,460 KB
testcase_01 AC 96 ms
37,256 KB
testcase_02 AC 99 ms
38,896 KB
testcase_03 AC 102 ms
37,540 KB
testcase_04 AC 102 ms
36,836 KB
testcase_05 AC 100 ms
37,440 KB
testcase_06 AC 101 ms
37,052 KB
testcase_07 AC 99 ms
37,272 KB
testcase_08 AC 98 ms
39,104 KB
testcase_09 AC 98 ms
37,172 KB
testcase_10 AC 100 ms
36,752 KB
testcase_11 AC 100 ms
37,452 KB
testcase_12 AC 99 ms
39,508 KB
testcase_13 AC 98 ms
39,088 KB
testcase_14 AC 100 ms
37,488 KB
testcase_15 AC 96 ms
39,464 KB
testcase_16 AC 97 ms
37,524 KB
testcase_17 AC 98 ms
38,880 KB
testcase_18 AC 96 ms
37,444 KB
testcase_19 AC 94 ms
37,348 KB
testcase_20 AC 97 ms
39,504 KB
testcase_21 AC 96 ms
37,360 KB
testcase_22 AC 97 ms
36,876 KB
testcase_23 AC 97 ms
36,968 KB
testcase_24 AC 97 ms
39,572 KB
testcase_25 AC 99 ms
37,504 KB
testcase_26 AC 96 ms
37,604 KB
testcase_27 AC 96 ms
39,424 KB
testcase_28 AC 95 ms
36,848 KB
testcase_29 AC 98 ms
39,260 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Linq;

class Program
{
    static void Main(string[] args)
    {
        int chkHani = 0;
        int ansHaniMin = 0;
        int ansHaniMax = (int)Math.Pow(10, 9);

        int rslt = 0;

        do
        {
            chkHani = (ansHaniMax - ansHaniMin) / 2 + ansHaniMin;
            Console.WriteLine("? {0}", chkHani);

            if (int.Parse(Console.ReadLine()) == 1) { ansHaniMin = chkHani; }
            else { ansHaniMax = chkHani; }

            if (ansHaniMax - ansHaniMin == 1) { ansHaniMax = ansHaniMin; }

        } while (ansHaniMin != ansHaniMax);

        Console.WriteLine("! {0}", ansHaniMin);
    }
}
0