結果

問題 No.381 名声値を稼ごう Extra
ユーザー noriocnorioc
提出日時 2016-06-18 01:13:26
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 697 bytes
コンパイル時間 940 ms
コンパイル使用メモリ 112,396 KB
実行使用メモリ 62,208 KB
最終ジャッジ日時 2024-04-18 02:30:26
合計ジャッジ時間 10,353 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
24,304 KB
testcase_01 TLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;

class Program {
    static string ReadLine() { return Console.ReadLine(); }
    static int ReadInt() { return int.Parse(ReadLine()); }
    static int[] ReadInts() { return ReadLine().Split().Select(int.Parse).ToArray(); }
    static string[] ReadStrings() { return ReadLine().Split(); }

    static void Main() {
        var n = BigInteger.Parse(ReadLine());
        int ans = 0;
        foreach (var a in n.ToByteArray()) {
            int x = a;
            while (x > 0) {
                if ((x & 1) != 0) ans++;
                x >>= 1;
            }
        }
        Console.WriteLine(ans);
    }
}
0