結果

問題 No.246 質問と回答
ユーザー AreTrashAreTrash
提出日時 2016-09-03 21:17:54
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 101 ms / 2,000 ms
コード長 642 bytes
コンパイル時間 2,026 ms
コンパイル使用メモリ 106,376 KB
実行使用メモリ 39,076 KB
平均クエリ数 30.90
最終ジャッジ日時 2023-09-23 20:18:19
合計ジャッジ時間 6,782 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 98 ms
36,960 KB
testcase_01 AC 97 ms
36,476 KB
testcase_02 AC 97 ms
37,028 KB
testcase_03 AC 96 ms
35,064 KB
testcase_04 AC 92 ms
35,040 KB
testcase_05 AC 97 ms
36,500 KB
testcase_06 AC 100 ms
38,816 KB
testcase_07 AC 100 ms
37,264 KB
testcase_08 AC 98 ms
36,536 KB
testcase_09 AC 97 ms
36,596 KB
testcase_10 AC 99 ms
36,552 KB
testcase_11 AC 96 ms
38,632 KB
testcase_12 AC 98 ms
36,868 KB
testcase_13 AC 101 ms
38,636 KB
testcase_14 AC 98 ms
38,380 KB
testcase_15 AC 92 ms
38,568 KB
testcase_16 AC 98 ms
36,512 KB
testcase_17 AC 98 ms
36,768 KB
testcase_18 AC 99 ms
36,464 KB
testcase_19 AC 100 ms
35,020 KB
testcase_20 AC 99 ms
37,200 KB
testcase_21 AC 97 ms
34,964 KB
testcase_22 AC 98 ms
38,540 KB
testcase_23 AC 99 ms
38,512 KB
testcase_24 AC 99 ms
36,484 KB
testcase_25 AC 99 ms
39,076 KB
testcase_26 AC 100 ms
36,608 KB
testcase_27 AC 97 ms
36,640 KB
testcase_28 AC 98 ms
36,940 KB
testcase_29 AC 97 ms
36,448 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