結果
問題 | No.1458 Segment Function |
ユーザー |
|
提出日時 | 2022-05-31 11:28:40 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 52 ms / 2,000 ms |
コード長 | 385 bytes |
コンパイル時間 | 267 ms |
コンパイル使用メモリ | 82,512 KB |
実行使用メモリ | 75,364 KB |
最終ジャッジ日時 | 2024-10-12 13:38:53 |
合計ジャッジ時間 | 3,017 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 32 |
ソースコード
P,N = input().split()import sysif N == "0":print(P)exit()d = [6,2,5,5,4,5,6,4,7,6]ans = 0if P[0] == "-":ans += 1P = P[1:]for p in P:ans += d[int(p)]if len(N) >= 4:N = 1000else:N = int(N) - 1def calc(S):tmp = 0while S:tmp += d[S % 10]S //= 10return tmpfor _ in range(N):ans = calc(ans)print(ans)