結果

問題 No.253 ロウソクの長さ
ユーザー NoNo
提出日時 2017-05-28 11:29:11
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,691 bytes
コンパイル時間 1,978 ms
コンパイル使用メモリ 104,644 KB
実行使用メモリ 39,096 KB
平均クエリ数 28.92
最終ジャッジ日時 2023-09-24 01:18:39
合計ジャッジ時間 8,957 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
36,532 KB
testcase_01 AC 65 ms
36,924 KB
testcase_02 AC 66 ms
36,752 KB
testcase_03 AC 66 ms
38,492 KB
testcase_04 AC 65 ms
36,656 KB
testcase_05 AC 66 ms
38,216 KB
testcase_06 AC 65 ms
36,224 KB
testcase_07 AC 65 ms
36,268 KB
testcase_08 AC 67 ms
38,628 KB
testcase_09 AC 68 ms
36,248 KB
testcase_10 AC 67 ms
38,748 KB
testcase_11 AC 68 ms
38,940 KB
testcase_12 AC 66 ms
38,776 KB
testcase_13 AC 66 ms
38,860 KB
testcase_14 AC 68 ms
39,096 KB
testcase_15 AC 69 ms
38,920 KB
testcase_16 AC 65 ms
36,696 KB
testcase_17 AC 60 ms
38,796 KB
testcase_18 AC 66 ms
38,636 KB
testcase_19 AC 67 ms
36,396 KB
testcase_20 AC 66 ms
36,908 KB
testcase_21 AC 66 ms
36,588 KB
testcase_22 AC 66 ms
38,432 KB
testcase_23 AC 67 ms
36,140 KB
testcase_24 AC 68 ms
34,620 KB
testcase_25 AC 66 ms
36,244 KB
testcase_26 AC 66 ms
34,708 KB
testcase_27 AC 65 ms
38,272 KB
testcase_28 AC 65 ms
36,616 KB
testcase_29 AC 66 ms
36,540 KB
testcase_30 AC 66 ms
38,336 KB
testcase_31 AC 65 ms
36,360 KB
testcase_32 AC 64 ms
20,676 KB
testcase_33 TLE -
testcase_34 -- -
testcase_35 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;
using System.Text;
namespace Yuki
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("? 100");
            string a = Console.ReadLine();
            if (a == "0")
            {
                Console.WriteLine("! 100");
            }
            else if (a == "-1")
            {
                aa();
            }
            else
            {
                bb();
            }
        }

        static void aa()
        {
            int c = 1;
            while (true)
            {
                Console.WriteLine("? 9");
                if (Console.ReadLine() == "0")
                {
                    Console.WriteLine("! {0}", 9 + c);
                    break;
                }
                else
                {
                    c++;
                }
            }
        }

        static void bb()
        {
            int ma = 1000000000 - 1;
            int mi = 100;
            int c = 1;
            int y = -1;
            while (ma > mi)
            {
                y = (ma + mi) / 2;
                Console.WriteLine("? {0}", y);
                string a = Console.ReadLine();
                if (a == "0")
                {
                    Console.WriteLine("! {0}", y + c);
                    break;
                }
                else if (a == "-1")
                {
                    ma = y - 1;
                    mi -= 1;
                    c++;
                }
                else
                {
                    ma -= 1;
                    mi = y - 1;
                    c++;
                }
            }
        }
    }
}
0