結果

問題 No.3290 Encrypt Failed, but Decrypt Succeeded
ユーザー tkykwtnb
提出日時 2025-10-03 22:38:03
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 443 bytes
コンパイル時間 275 ms
コンパイル使用メモリ 82,276 KB
実行使用メモリ 812,256 KB
最終ジャッジ日時 2025-10-03 22:38:10
合計ジャッジ時間 6,717 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 4 WA * 1 MLE * 1 -- * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(10**6)
N,K=map(int,input().split())
t=list(input())
S=set()
def dfs(s,t):
    global S
    if len(t)==0:
        S.add(tuple(s))
        return
    if len(t)>=2 and t[1]=="0":dfs(s+[int("".join(t[:2]))],t[2:])
    else:dfs(s+[int(t[0])],t[1:])
    if int("".join(t[:2]))<=26:dfs(s+[int("".join(t[:2]))],t[2:])
dfs([],t)
S=sorted(S)
ans=[]
for c in S[K-1]:
    ans.append(chr(ord("a")+c-1))
print("".join(ans))
0