結果
問題 | No.1458 Segment Function |
ユーザー |
👑 ![]() |
提出日時 | 2021-03-31 22:08:56 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 49 ms / 2,000 ms |
コード長 | 670 bytes |
コンパイル時間 | 441 ms |
コンパイル使用メモリ | 81,792 KB |
実行使用メモリ | 66,688 KB |
最終ジャッジ日時 | 2024-10-12 13:35:59 |
合計ジャッジ時間 | 2,804 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 32 |
ソースコード
""" """ import sys from sys import stdin lis = [6,2,5,5,4,5,6,4,7,6] def f2(x): ret = 0 for i in x: if i == "-": ret += 1 else: ret += lis[int(i)] return ret def f(x): ret = 0 if x < 0: ret += 1 x *= -1 while x > 0: ret += lis[x % 10] x //= 10 return ret P,N = stdin.readline().split() if N == "0": print (P) sys.exit() if len(N) >= 1000: N = float("inf") else: N = int(N) P = f2(P) N -= 1 while N > 0: P = f(P) N -= 1 if 4 <= P <= 6: break print (P)