結果

問題 No.104 国道
ユーザー Daiki_000
提出日時 2025-01-14 20:25:07
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 33 ms / 5,000 ms
コード長 526 bytes
コンパイル時間 496 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,368 KB
最終ジャッジ日時 2025-01-14 20:25:10
合計ジャッジ時間 2,366 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

def walk_national_root(root, branch_root):
    courent_root = root
    for i in range(len(branch_root)):
        if branch_root[i] == "L":
            courent_root = courent_root * 2
        elif branch_root[i] == "R":
            courent_root = courent_root * 2 + 1
    return courent_root


def main():
    root = 1
    try:
        branch_root = list(input())
        answer = walk_national_root(root, branch_root)
        print(answer)
    except EOFError as e:
        print(root)


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