結果

問題 No.1458 Segment Function
ユーザー netyo715netyo715
提出日時 2021-03-31 21:38:34
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 379 bytes
コンパイル時間 83 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,904 KB
最終ジャッジ日時 2024-04-20 17:37:22
合計ジャッジ時間 2,461 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,752 KB
testcase_01 AC 28 ms
10,880 KB
testcase_02 AC 27 ms
10,752 KB
testcase_03 AC 28 ms
10,880 KB
testcase_04 AC 29 ms
10,880 KB
testcase_05 AC 28 ms
10,752 KB
testcase_06 AC 28 ms
10,752 KB
testcase_07 AC 29 ms
10,752 KB
testcase_08 AC 61 ms
11,136 KB
testcase_09 AC 61 ms
11,136 KB
testcase_10 AC 63 ms
11,008 KB
testcase_11 AC 61 ms
11,008 KB
testcase_12 AC 66 ms
11,136 KB
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 AC 29 ms
10,752 KB
testcase_24 AC 29 ms
11,136 KB
testcase_25 AC 28 ms
10,752 KB
testcase_26 RE -
testcase_27 RE -
testcase_28 AC 28 ms
10,880 KB
testcase_29 AC 28 ms
11,136 KB
testcase_30 AC 29 ms
11,136 KB
testcase_31 RE -
testcase_32 AC 63 ms
11,008 KB
testcase_33 AC 59 ms
11,136 KB
testcase_34 AC 63 ms
11,136 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

P, N = input().split()
N = int(N)

f = {"0": 6, "1": 2, "2": 5, "3": 5, "4": 4, "5": 5, "6": 6, "7": 4, "8": 7, "9": 6, "-": 1}

last = dict()
A = [P]

i = 0
while i<N:
    x = 0
    for p in A[-1]:
        x += f[p]
    
    x = str(x)

    if x in last:
        looplen = i-last[x]
        N -= looplen*((N-i)//looplen)

    A.append(x)
    last[x] = i
    i += 1

print(A[-1])
0