結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー NoNo
提出日時 2015-04-21 16:20:21
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 685 bytes
コンパイル時間 1,995 ms
コンパイル使用メモリ 99,676 KB
実行使用メモリ 25,344 KB
最終ジャッジ日時 2023-09-18 02:18:07
合計ジャッジ時間 4,362 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
21,116 KB
testcase_01 AC 55 ms
20,980 KB
testcase_02 AC 56 ms
20,936 KB
testcase_03 AC 55 ms
21,172 KB
testcase_04 AC 57 ms
21,112 KB
testcase_05 AC 58 ms
21,032 KB
testcase_06 AC 56 ms
23,204 KB
testcase_07 AC 56 ms
21,224 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 56 ms
23,160 KB
testcase_11 AC 56 ms
21,100 KB
testcase_12 AC 56 ms
23,152 KB
testcase_13 AC 56 ms
23,160 KB
testcase_14 AC 56 ms
21,088 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 55 ms
23,212 KB
testcase_18 AC 55 ms
23,164 KB
testcase_19 AC 56 ms
23,292 KB
testcase_20 AC 55 ms
21,172 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 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;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ForYukicoder
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            int count;

            count = (int)Math.Log(N, 2);
            int cookie = (int)(N % Math.Pow(2, count));

            if (cookie == 0)
            {

            }
            else if (cookie == 1 || cookie % 2 == 0)
            {
                count += 1;
            }
            else
            {
                count += 2;
            }

            Console.WriteLine(count);
        }
    }
}
0