結果

問題 No.1458 Segment Function
ユーザー 👑 rin204rin204
提出日時 2023-04-21 23:23:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 202 ms / 2,000 ms
コード長 293 bytes
コンパイル時間 201 ms
コンパイル使用メモリ 82,816 KB
実行使用メモリ 80,000 KB
最終ジャッジ日時 2024-04-24 09:21:41
合計ジャッジ時間 5,187 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,096 KB
testcase_01 AC 37 ms
52,096 KB
testcase_02 AC 34 ms
51,584 KB
testcase_03 AC 34 ms
51,840 KB
testcase_04 AC 35 ms
51,840 KB
testcase_05 AC 44 ms
51,968 KB
testcase_06 AC 38 ms
51,840 KB
testcase_07 AC 35 ms
52,096 KB
testcase_08 AC 159 ms
78,720 KB
testcase_09 AC 165 ms
78,592 KB
testcase_10 AC 165 ms
78,464 KB
testcase_11 AC 170 ms
78,336 KB
testcase_12 AC 162 ms
78,720 KB
testcase_13 AC 74 ms
72,192 KB
testcase_14 AC 73 ms
72,192 KB
testcase_15 AC 72 ms
71,808 KB
testcase_16 AC 72 ms
72,192 KB
testcase_17 AC 76 ms
72,064 KB
testcase_18 AC 187 ms
80,000 KB
testcase_19 AC 199 ms
79,616 KB
testcase_20 AC 202 ms
79,360 KB
testcase_21 AC 196 ms
79,616 KB
testcase_22 AC 197 ms
79,744 KB
testcase_23 AC 35 ms
52,608 KB
testcase_24 AC 158 ms
74,368 KB
testcase_25 AC 39 ms
51,968 KB
testcase_26 AC 116 ms
78,208 KB
testcase_27 AC 124 ms
78,336 KB
testcase_28 AC 35 ms
51,968 KB
testcase_29 AC 96 ms
73,216 KB
testcase_30 AC 94 ms
73,344 KB
testcase_31 AC 59 ms
72,064 KB
testcase_32 AC 176 ms
78,336 KB
testcase_33 AC 169 ms
78,592 KB
testcase_34 AC 173 ms
78,720 KB
権限があれば一括ダウンロードができます

ソースコード

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