結果

問題 No.1458 Segment Function
ユーザー roarisroaris
提出日時 2021-03-31 22:31:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 72 ms / 2,000 ms
コード長 625 bytes
コンパイル時間 407 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 77,428 KB
最終ジャッジ日時 2024-04-20 17:40:32
合計ジャッジ時間 3,642 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,632 KB
testcase_01 AC 40 ms
53,248 KB
testcase_02 AC 40 ms
53,760 KB
testcase_03 AC 48 ms
61,568 KB
testcase_04 AC 41 ms
54,004 KB
testcase_05 AC 42 ms
53,888 KB
testcase_06 AC 51 ms
65,024 KB
testcase_07 AC 43 ms
54,016 KB
testcase_08 AC 55 ms
67,584 KB
testcase_09 AC 54 ms
67,200 KB
testcase_10 AC 54 ms
67,072 KB
testcase_11 AC 57 ms
67,712 KB
testcase_12 AC 61 ms
67,584 KB
testcase_13 AC 59 ms
71,552 KB
testcase_14 AC 60 ms
71,680 KB
testcase_15 AC 54 ms
65,536 KB
testcase_16 AC 53 ms
65,792 KB
testcase_17 AC 59 ms
71,808 KB
testcase_18 AC 69 ms
76,800 KB
testcase_19 AC 68 ms
76,800 KB
testcase_20 AC 70 ms
76,800 KB
testcase_21 AC 70 ms
77,428 KB
testcase_22 AC 70 ms
76,928 KB
testcase_23 AC 41 ms
54,272 KB
testcase_24 AC 42 ms
54,912 KB
testcase_25 AC 43 ms
53,760 KB
testcase_26 AC 69 ms
76,756 KB
testcase_27 AC 72 ms
77,184 KB
testcase_28 AC 39 ms
54,016 KB
testcase_29 AC 43 ms
55,168 KB
testcase_30 AC 41 ms
54,912 KB
testcase_31 AC 57 ms
71,552 KB
testcase_32 AC 54 ms
67,200 KB
testcase_33 AC 52 ms
67,712 KB
testcase_34 AC 51 ms
67,328 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from collections import *

P, N = input().split()
seg = [1, 6, 2, 5, 5, 4, 5, 6, 4, 7, 6]

if len(N)<=5:
    for _ in range(int(N)):
        fp = 0
        
        for i in range(len(P)):
            if P[i]=='-':
                fp += seg[0]
            else:
                fp += seg[int(P[i])+1]
    
        P = str(fp)
    
    print(P)
else:
    for _ in range(10**5):
        fp = 0
        
        for i in range(len(P)):
            if P[i]=='-':
                fp += seg[0]
            else:
                fp += seg[int(P[i])+1]
    
        P = str(fp)
    
    print(P)
0