結果

問題 No.1458 Segment Function
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2021-03-31 21:57:42
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 685 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 82,464 KB
実行使用メモリ 82,612 KB
最終ジャッジ日時 2024-05-09 07:34:17
合計ジャッジ時間 5,823 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
59,700 KB
testcase_01 AC 37 ms
52,400 KB
testcase_02 AC 36 ms
52,660 KB
testcase_03 AC 36 ms
51,876 KB
testcase_04 AC 36 ms
52,740 KB
testcase_05 AC 35 ms
52,800 KB
testcase_06 AC 35 ms
52,268 KB
testcase_07 AC 36 ms
52,124 KB
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 AC 36 ms
53,544 KB
testcase_14 AC 38 ms
53,284 KB
testcase_15 AC 37 ms
52,996 KB
testcase_16 AC 37 ms
54,428 KB
testcase_17 AC 37 ms
55,072 KB
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 WA -
testcase_26 RE -
testcase_27 RE -
testcase_28 AC 36 ms
52,620 KB
testcase_29 RE -
testcase_30 RE -
testcase_31 TLE -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

"""



"""

import sys
from sys import stdin

lis = [6,2,5,5,4,5,6,4,7,6]

def f(x):

    if type(x) == type(lis):
        ret = 0
        for i in x:
            if i == "-":
                ret += 1
            else:
                ret += lis[int(i)]
        return ret

    else:
        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 len(N) >= 1000:
    N = float("inf")
else:
    N = int(N)

if len(P) < 100:
    P = int(P)

while (type(P) != type(lis) and not(4 <= P <= 6)) and N > 0:
    P = f(P)
    N -= 1

print (P)
0