結果

問題 No.1458 Segment Function
ユーザー hir355
提出日時 2021-03-31 21:31:11
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 271 bytes
コンパイル時間 458 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 67,072 KB
最終ジャッジ日時 2024-12-15 15:29:27
合計ジャッジ時間 3,757 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7 WA * 1 RE * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

a = [6, 2, 5, 5, 4, 5, 6, 4, 7, 6]
p, n = map(int, input().split())
if n == 0:
    print(p)
    exit(0)
if p < 0:
    n -= 1
    p = -p + 1
    sg = 1
for i in range(min(n, 100)):
    res = 0
    for c in str(p):
        res += a[ord(c) - ord('0')]
    p = res
print(res)
0