結果

問題 No.253 ロウソクの長さ
ユーザー shimashimau67shimashimau67
提出日時 2015-08-01 17:43:01
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 839 bytes
コンパイル時間 2,558 ms
コンパイル使用メモリ 105,152 KB
実行使用メモリ 40,368 KB
平均クエリ数 60.67
最終ジャッジ日時 2023-09-23 05:30:33
合計ジャッジ時間 9,411 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 76 ms
36,812 KB
testcase_02 AC 78 ms
38,308 KB
testcase_03 AC 78 ms
36,308 KB
testcase_04 RE -
testcase_05 AC 78 ms
34,816 KB
testcase_06 WA -
testcase_07 AC 78 ms
36,376 KB
testcase_08 WA -
testcase_09 RE -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 RE -
testcase_15 AC 77 ms
36,492 KB
testcase_16 AC 77 ms
36,888 KB
testcase_17 AC 77 ms
36,248 KB
testcase_18 AC 76 ms
36,344 KB
testcase_19 RE -
testcase_20 WA -
testcase_21 AC 77 ms
36,888 KB
testcase_22 AC 78 ms
36,316 KB
testcase_23 WA -
testcase_24 AC 79 ms
36,324 KB
testcase_25 WA -
testcase_26 AC 76 ms
37,016 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 76 ms
36,400 KB
testcase_33 WA -
testcase_34 RE -
testcase_35 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.Generic;
class Program
{
    //http://yukicoder.me/submissions/36416 ←参考にさせていただきました
    static void Main(string[] args)
    {
        int max = 100000000 + 1;
        int min = 0;
        int help = 0;

        while (help < 100)
        {
            int mid = (min + max) / 2;
            Console.WriteLine("? " + (mid - help));
            int answer = int.Parse(Console.ReadLine());
            if (answer == 1)//↑にある
            {
                min = mid;
            }
            else if(answer == -1)//↓にある
            {
                max = mid;
            }
            else //ちょうどやで
            {
                Console.WriteLine("! "+ mid);
                break;
            }
            help++;
        }
        
    }
}
0