結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 104 ms
36,860 KB
testcase_01 AC 97 ms
37,224 KB
testcase_02 AC 97 ms
35,444 KB
testcase_03 AC 99 ms
36,988 KB
testcase_04 AC 101 ms
36,936 KB
testcase_05 AC 100 ms
39,404 KB
testcase_06 AC 99 ms
37,452 KB
testcase_07 AC 99 ms
37,496 KB
testcase_08 AC 97 ms
39,436 KB
testcase_09 AC 97 ms
37,408 KB
testcase_10 AC 98 ms
37,080 KB
testcase_11 AC 99 ms
37,048 KB
testcase_12 AC 98 ms
37,280 KB
testcase_13 AC 96 ms
37,584 KB
testcase_14 AC 96 ms
39,160 KB
testcase_15 AC 101 ms
35,384 KB
testcase_16 AC 94 ms
37,132 KB
testcase_17 AC 94 ms
39,016 KB
testcase_18 AC 96 ms
39,404 KB
testcase_19 AC 97 ms
37,532 KB
testcase_20 AC 95 ms
37,544 KB
testcase_21 AC 95 ms
36,904 KB
testcase_22 AC 94 ms
37,152 KB
testcase_23 AC 96 ms
37,632 KB
testcase_24 AC 96 ms
37,572 KB
testcase_25 AC 96 ms
37,016 KB
testcase_26 AC 96 ms
36,928 KB
testcase_27 AC 97 ms
39,020 KB
testcase_28 AC 97 ms
37,252 KB
testcase_29 AC 97 ms
37,480 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);

        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