結果

問題 No.378 名声値を稼ごう
ユーザー qwrtpsfgqwrtpsfg
提出日時 2017-08-28 21:40:25
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 62 ms / 2,000 ms
コード長 392 bytes
コンパイル時間 5,084 ms
コンパイル使用メモリ 100,968 KB
実行使用メモリ 22,844 KB
最終ジャッジ日時 2023-09-12 15:03:00
合計ジャッジ時間 6,077 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
20,788 KB
testcase_01 AC 61 ms
20,840 KB
testcase_02 AC 62 ms
20,952 KB
testcase_03 AC 61 ms
20,784 KB
testcase_04 AC 61 ms
20,780 KB
testcase_05 AC 61 ms
22,844 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.Linq;
using System.Collections.Generic;

public class yukicoder
{
    public static decimal meiseiti(decimal n)
    {
        if(n == 0) return 0;
        return n + meiseiti(Math.Truncate(n / 2));
    }
    
    public static void Main()
    {
	decimal input = decimal.Parse(Console.ReadLine());

        Console.WriteLine((input * 2) - meiseiti(input));
    }
}

0