結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー shirokuro9586shirokuro9586
提出日時 2017-09-27 23:23:21
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 98 ms / 5,000 ms
コード長 775 bytes
コンパイル時間 707 ms
コンパイル使用メモリ 107,068 KB
実行使用メモリ 25,696 KB
最終ジャッジ日時 2024-04-27 14:55:17
合計ジャッジ時間 2,574 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 98 ms
23,860 KB
testcase_01 AC 21 ms
23,640 KB
testcase_02 AC 23 ms
23,256 KB
testcase_03 AC 22 ms
23,772 KB
testcase_04 AC 61 ms
23,644 KB
testcase_05 AC 23 ms
23,648 KB
testcase_06 AC 24 ms
25,444 KB
testcase_07 AC 22 ms
21,436 KB
testcase_08 AC 66 ms
23,516 KB
testcase_09 AC 28 ms
23,648 KB
testcase_10 AC 85 ms
23,516 KB
testcase_11 AC 56 ms
21,432 KB
testcase_12 AC 50 ms
25,696 KB
testcase_13 AC 45 ms
23,524 KB
testcase_14 AC 70 ms
23,388 KB
testcase_15 AC 29 ms
24,024 KB
testcase_16 AC 36 ms
25,440 KB
testcase_17 AC 44 ms
25,688 KB
testcase_18 AC 28 ms
23,600 KB
testcase_19 AC 24 ms
23,724 KB
testcase_20 AC 39 ms
23,648 KB
testcase_21 AC 32 ms
23,776 KB
testcase_22 AC 43 ms
23,524 KB
testcase_23 AC 64 ms
23,648 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;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleProgram
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            int Biscket_num = 1;
            int HandNum = 0;
            int PocketNum = 1;
            int count = 0;
            while(Biscket_num != N)
            {
                while((PocketNum * 2)+ HandNum > N )
                {
                    PocketNum--;
                    HandNum++;
                }
                PocketNum *= 2;
                Biscket_num = PocketNum + HandNum;
                count++;
            }
            Console.WriteLine("{0}",count);

        }
   }
}
0