結果

問題 No.246 質問と回答
ユーザー mbanmban
提出日時 2017-01-04 02:54:39
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 104 ms / 2,000 ms
コード長 642 bytes
コンパイル時間 2,983 ms
コンパイル使用メモリ 103,444 KB
実行使用メモリ 39,184 KB
平均クエリ数 30.90
最終ジャッジ日時 2023-09-23 20:20:47
合計ジャッジ時間 7,295 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 104 ms
35,012 KB
testcase_01 AC 102 ms
38,440 KB
testcase_02 AC 102 ms
36,404 KB
testcase_03 AC 103 ms
36,924 KB
testcase_04 AC 101 ms
37,036 KB
testcase_05 AC 100 ms
37,080 KB
testcase_06 AC 99 ms
36,844 KB
testcase_07 AC 99 ms
37,048 KB
testcase_08 AC 102 ms
39,184 KB
testcase_09 AC 100 ms
36,388 KB
testcase_10 AC 100 ms
37,140 KB
testcase_11 AC 98 ms
37,180 KB
testcase_12 AC 101 ms
36,548 KB
testcase_13 AC 100 ms
37,048 KB
testcase_14 AC 101 ms
36,956 KB
testcase_15 AC 103 ms
37,084 KB
testcase_16 AC 100 ms
36,556 KB
testcase_17 AC 100 ms
39,136 KB
testcase_18 AC 97 ms
35,108 KB
testcase_19 AC 99 ms
36,928 KB
testcase_20 AC 99 ms
37,024 KB
testcase_21 AC 101 ms
36,476 KB
testcase_22 AC 102 ms
36,512 KB
testcase_23 AC 101 ms
38,560 KB
testcase_24 AC 99 ms
34,716 KB
testcase_25 AC 100 ms
36,400 KB
testcase_26 AC 100 ms
38,768 KB
testcase_27 AC 100 ms
37,020 KB
testcase_28 AC 100 ms
36,652 KB
testcase_29 AC 100 ms
34,424 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

namespace No246{
    public class Program{
        public static void Main(string[] args){
            Func<int, bool> q = x => {
                Console.WriteLine($"? {x}");
                return int.Parse(Console.ReadLine().Split(' ')[0]) == 0;
            };

            var left = 0;
            var right = 1000000001;

            while(left < right){
                var mid = (left + right) / 2;
                if(q(mid)){
                    right = mid;
                } else { 
                    left = mid + 1;
                }
            }

            Console.WriteLine($"! {left - 1}");
        }
    }
}
0