結果

問題 No.1458 Segment Function
ユーザー NatsubiSoganNatsubiSogan
提出日時 2021-03-31 22:03:32
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 86 ms / 2,000 ms
コード長 282 bytes
コンパイル時間 1,289 ms
コンパイル使用メモリ 87,100 KB
実行使用メモリ 78,104 KB
最終ジャッジ日時 2023-08-02 17:31:21
合計ジャッジ時間 4,290 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
71,200 KB
testcase_01 AC 67 ms
71,272 KB
testcase_02 AC 64 ms
71,324 KB
testcase_03 AC 73 ms
75,948 KB
testcase_04 AC 65 ms
71,224 KB
testcase_05 AC 68 ms
71,252 KB
testcase_06 AC 72 ms
76,072 KB
testcase_07 AC 68 ms
71,220 KB
testcase_08 AC 80 ms
77,096 KB
testcase_09 AC 82 ms
77,148 KB
testcase_10 AC 78 ms
77,516 KB
testcase_11 AC 78 ms
77,172 KB
testcase_12 AC 80 ms
77,356 KB
testcase_13 AC 66 ms
71,912 KB
testcase_14 AC 65 ms
71,692 KB
testcase_15 AC 68 ms
71,828 KB
testcase_16 AC 66 ms
71,768 KB
testcase_17 AC 67 ms
71,860 KB
testcase_18 AC 82 ms
78,068 KB
testcase_19 AC 82 ms
77,908 KB
testcase_20 AC 80 ms
77,988 KB
testcase_21 AC 83 ms
77,892 KB
testcase_22 AC 82 ms
78,104 KB
testcase_23 AC 65 ms
71,288 KB
testcase_24 AC 66 ms
72,092 KB
testcase_25 AC 64 ms
70,968 KB
testcase_26 AC 85 ms
77,892 KB
testcase_27 AC 84 ms
77,880 KB
testcase_28 AC 64 ms
71,156 KB
testcase_29 AC 65 ms
71,888 KB
testcase_30 AC 71 ms
72,112 KB
testcase_31 AC 71 ms
72,000 KB
testcase_32 AC 86 ms
77,464 KB
testcase_33 AC 84 ms
77,160 KB
testcase_34 AC 85 ms
77,276 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def seg(x):
    if x[0] == "-": return 1 + seg(x[1:])
    elif len(x) >= 2: return sum(seg(i) for i in x)
    else:
        return [6, 2, 5, 5, 4, 5, 6, 4, 7, 6][int(x)]
p, n = input().split()
now = p
if len(n) > 10: n = 10
for i in range(int(n)):
    now = str(seg(now))
print(now)
0