結果
| 問題 |
No.737 PopCount
|
| コンテスト | |
| ユーザー |
convexineq
|
| 提出日時 | 2021-03-16 17:27:36 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 277 bytes |
| コンパイル時間 | 431 ms |
| コンパイル使用メモリ | 82,048 KB |
| 実行使用メモリ | 65,920 KB |
| 最終ジャッジ日時 | 2024-11-08 02:45:22 |
| 合計ジャッジ時間 | 2,282 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 3 |
| other | RE * 15 |
ソースコード
from functools import lru_cache
@lru_cache(maxsize=None)
def f(n):
# 返り値: sum(x*ppopcnt(x)), sum(popcnt(x))
if n==0: return 0,0
a,b,c,d = f(n//2),f((n-1)//2)
x = (n+n%2)//2
return 2*(a+c) + d + x*x, b + d + x
n = int(input())
print(f(n)[0]%(10**9+7))
convexineq