結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー Masahiro HayashiMasahiro Hayashi
提出日時 2014-11-24 00:27:42
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 62 ms / 5,000 ms
コード長 1,593 bytes
コンパイル時間 3,451 ms
コンパイル使用メモリ 103,520 KB
実行使用メモリ 25,168 KB
最終ジャッジ日時 2023-08-30 22:37:52
合計ジャッジ時間 6,172 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
22,920 KB
testcase_01 AC 61 ms
22,972 KB
testcase_02 AC 61 ms
25,168 KB
testcase_03 AC 60 ms
24,924 KB
testcase_04 AC 60 ms
22,824 KB
testcase_05 AC 58 ms
21,136 KB
testcase_06 AC 61 ms
24,848 KB
testcase_07 AC 61 ms
22,816 KB
testcase_08 AC 61 ms
22,892 KB
testcase_09 AC 60 ms
22,904 KB
testcase_10 AC 61 ms
23,020 KB
testcase_11 AC 61 ms
23,068 KB
testcase_12 AC 61 ms
23,160 KB
testcase_13 AC 62 ms
24,920 KB
testcase_14 AC 60 ms
22,756 KB
testcase_15 AC 60 ms
24,936 KB
testcase_16 AC 60 ms
22,824 KB
testcase_17 AC 61 ms
22,884 KB
testcase_18 AC 60 ms
22,904 KB
testcase_19 AC 61 ms
20,768 KB
testcase_20 AC 61 ms
24,924 KB
testcase_21 AC 60 ms
22,756 KB
testcase_22 AC 61 ms
22,908 KB
testcase_23 AC 61 ms
24,980 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.Generic;

namespace Application
{
	class MainClass
	{
		public static void Main (string[] args)
		{
            var N = scanNextDigit();

            writeLine(Math.Ceiling(Math.Log((double)N, 2)));
		}

        static void writeLine(object o)
        {
            System.Console.WriteLine(o.ToString());
        }

        static int[] scanNextDigits(int count)
        {
            var res = new List<int>();

            for (int i = 0; i < count; i++)
            {
                res.Add(scanNextDigit());
            }

            return res.ToArray();
        }

        static string scanNextToken()
        {
            int i;
            var r = new List<char>();

            while ((i = System.Console.Read()) >= 0)
            {
                var c = Convert.ToChar(i);
                if (!isSpace(c))
                {
                    r.Add(c);
                }
                else if (r.Count > 0)
                {
                    break;
                }
            }

            return new string(r.ToArray());
        }

        static bool isSpace(char c)
        {
            switch (c)
            {
                case '\t':
                case '\n':
                case ' ':
                    return true;
                default:
                    return false;
            }
        }

        static int scanNextDigit()
        {
            var token = scanNextToken();

            return int.Parse(token);
        }

	}
}
0