結果

問題 No.378 名声値を稼ごう
ユーザー qwrtpsfg
提出日時 2017-08-28 21:40:25
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 26 ms / 2,000 ms
コード長 392 bytes
コンパイル時間 3,696 ms
コンパイル使用メモリ 108,172 KB
実行使用メモリ 26,068 KB
最終ジャッジ日時 2024-06-30 03:05:53
合計ジャッジ時間 4,289 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 5
権限があれば一括ダウンロードができます
コンパイルメッセージ
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