結果

問題 No.378 名声値を稼ごう
ユーザー huffman56huffman56
提出日時 2022-11-12 08:53:16
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 54 ms / 2,000 ms
コード長 538 bytes
コンパイル時間 4,741 ms
コンパイル使用メモリ 103,060 KB
実行使用メモリ 22,744 KB
最終ジャッジ日時 2023-10-12 01:19:46
合計ジャッジ時間 6,017 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
22,744 KB
testcase_01 AC 53 ms
18,744 KB
testcase_02 AC 54 ms
20,632 KB
testcase_03 AC 53 ms
22,744 KB
testcase_04 AC 53 ms
18,564 KB
testcase_05 AC 54 ms
20,784 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.Numerics;
using static System.Math;

namespace SortItems
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = long.Parse(Console.ReadLine());
            long m = n;
            long d = 0;

            // 通常の値を取得する
            while(m > 0)
            {
                d += m;
                m = m / 2;
            }
            
            Console.WriteLine((n * 2) - d);


        }
    }
}
0