結果

問題 No.378 名声値を稼ごう
コンテスト
ユーザー yumechi
提出日時 2016-08-06 01:08:34
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 24 ms / 2,000 ms
コード長 275 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,419 ms
コンパイル使用メモリ 85,320 KB
実行使用メモリ 52,224 KB
最終ジャッジ日時 2026-03-19 03:28:09
合計ジャッジ時間 2,045 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

def solve():
    n = int(input())
    arr, nc = [], n
    while nc > 0:
        arr.append(nc)
        nc //= 2
    arr.append(0)
    standardscore = sum(arr)
    print(arr[0] + arr[1] * 2 + (arr[0] % 2 == 1 if 1 else 0) - standardscore)

if __name__=="__main__":
    solve()
0