結果

問題 No.378 名声値を稼ごう
ユーザー kmtrc130kmtrc130
提出日時 2017-05-30 09:22:22
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 61 ms / 2,000 ms
コード長 478 bytes
コンパイル時間 2,423 ms
コンパイル使用メモリ 104,236 KB
実行使用メモリ 22,820 KB
最終ジャッジ日時 2023-09-12 12:54:16
合計ジャッジ時間 3,410 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
22,820 KB
testcase_01 AC 60 ms
20,732 KB
testcase_02 AC 60 ms
20,872 KB
testcase_03 AC 61 ms
20,808 KB
testcase_04 AC 60 ms
20,880 KB
testcase_05 AC 61 ms
20,816 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;

class Program
{
    static void Main(string[] args)
    {
        decimal N = decimal.Parse(Console.ReadLine());
        decimal num = 0;
        decimal max = 0;

        decimal std = 0;
        do
        {
            std += N;

            num = std + N;
            if (max < num) { max = num; }

            N = Math.Floor(N / 2);
        } while (0 < N);

        Console.WriteLine(max - std);
    }
}
0