結果
| 問題 |
No.381 名声値を稼ごう Extra
|
| コンテスト | |
| ユーザー |
maspy
|
| 提出日時 | 2020-03-17 13:13:21 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 494 bytes |
| コンパイル時間 | 332 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 12,544 KB |
| 最終ジャッジ日時 | 2024-11-30 16:57:31 |
| 合計ジャッジ時間 | 556 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 RE * 1 |
ソースコード
#!/usr/bin/env python3.8
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def to_int(word):
L = len(word)
if len(word) < 10000:
return int(word)
mid = L // 2
n1 = to_int(word[:mid])
n2 = to_int(word[mid:])
return pow(10, L - mid) * n1 + n2
popcount = {hex(n)[2]: sum(map(int, bin(n)[2:])) for n in range(16)}
answer = sum(popcount[x] for x in hex(to_int(read().rstrip()))[2:])
print(answer)
maspy