結果

問題 No.1458 Segment Function
ユーザー rin204
提出日時 2023-04-21 23:23:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 217 ms / 2,000 ms
コード長 293 bytes
コンパイル時間 388 ms
コンパイル使用メモリ 81,832 KB
実行使用メモリ 79,656 KB
最終ジャッジ日時 2024-11-06 16:46:11
合計ジャッジ時間 5,746 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys


sys.set_int_max_str_digits(10 ** 9)

p, n = map(int, input().split())

def f(S):
    if S == "-":
        return 1
    else:
        return [6, 2, 5, 5, 4, 5, 6, 4, 7, 6][int(S)]

for _ in range(n):
    nex = sum(map(f, str(p)))
    if nex == p:
        break
    p = nex
print(p)
0