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