結果
| 問題 |
No.381 名声値を稼ごう Extra
|
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2016-06-18 01:13:26 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 697 bytes |
| コンパイル時間 | 897 ms |
| コンパイル使用メモリ | 112,180 KB |
| 実行使用メモリ | 64,380 KB |
| 最終ジャッジ日時 | 2024-10-09 20:11:13 |
| 合計ジャッジ時間 | 10,356 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 TLE * 1 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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);
}
}
norioc