結果

問題 No.253 ロウソクの長さ
ユーザー mbanmban
提出日時 2017-04-28 10:13:20
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 74 ms / 2,000 ms
コード長 1,218 bytes
コンパイル時間 4,523 ms
コンパイル使用メモリ 104,528 KB
実行使用メモリ 39,080 KB
平均クエリ数 23.89
最終ジャッジ日時 2023-09-24 01:00:27
合計ジャッジ時間 8,257 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
36,888 KB
testcase_01 AC 68 ms
38,312 KB
testcase_02 AC 66 ms
36,888 KB
testcase_03 AC 65 ms
36,416 KB
testcase_04 AC 65 ms
37,032 KB
testcase_05 AC 64 ms
36,872 KB
testcase_06 AC 67 ms
36,700 KB
testcase_07 AC 70 ms
38,680 KB
testcase_08 AC 70 ms
36,604 KB
testcase_09 AC 66 ms
38,456 KB
testcase_10 AC 74 ms
36,440 KB
testcase_11 AC 67 ms
37,056 KB
testcase_12 AC 65 ms
36,684 KB
testcase_13 AC 64 ms
36,760 KB
testcase_14 AC 66 ms
38,400 KB
testcase_15 AC 66 ms
36,776 KB
testcase_16 AC 67 ms
36,900 KB
testcase_17 AC 68 ms
38,372 KB
testcase_18 AC 66 ms
36,964 KB
testcase_19 AC 66 ms
38,324 KB
testcase_20 AC 65 ms
36,864 KB
testcase_21 AC 66 ms
38,744 KB
testcase_22 AC 64 ms
38,280 KB
testcase_23 AC 66 ms
39,080 KB
testcase_24 AC 66 ms
36,852 KB
testcase_25 AC 65 ms
38,380 KB
testcase_26 AC 66 ms
38,872 KB
testcase_27 AC 65 ms
38,472 KB
testcase_28 AC 66 ms
36,240 KB
testcase_29 AC 66 ms
36,712 KB
testcase_30 AC 66 ms
38,328 KB
testcase_31 AC 69 ms
36,380 KB
testcase_32 AC 71 ms
38,332 KB
testcase_33 AC 66 ms
36,676 KB
testcase_34 AC 64 ms
34,364 KB
testcase_35 AC 66 ms
38,716 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.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;

public class Program
{
    static public void Main(string[] args)
    {
        Console.WriteLine("? 64");
        string s = Console.ReadLine();
        int min = -1, max = -1;
        switch (s)
        {
            case "-1":
                max = 64;
                min = 10;
                break;
            case "1":
                max = (int)1e9 + 1;
                min = 65;
                break;
            case "0":
                Console.WriteLine("! 64");
                return;
        }

        for (int i = 1; ; i++)
        {
            int mid = (min + max) / 2;
            Console.WriteLine($"? {mid - i}");
            s = Console.ReadLine();
            switch (s)
            {
                case "-1":
                    max = mid - 1;

                    break;
                case "1":

                    min = mid + 1;
                    break;
                case "0":
                    Console.WriteLine($"! {mid}");
                    return;
            }
        }
    }
}

0