結果
| 問題 | No.3290 Encrypt Failed, but Decrypt Succeeded |
| コンテスト | |
| ユーザー |
sasa8uyauya
|
| 提出日時 | 2025-10-03 22:14:45 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 438 bytes |
| 記録 | |
| コンパイル時間 | 235 ms |
| コンパイル使用メモリ | 95,604 KB |
| 実行使用メモリ | 95,872 KB |
| 最終ジャッジ日時 | 2026-07-15 09:49:41 |
| 合計ジャッジ時間 | 7,284 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 5 RE * 22 |
ソースコード
n,K=map(int,input().split())
T=input()
from functools import cache
@cache
def f(x):
if x==n:
return 1
c=0
if x+1<=n and 1<=int(T[x:x+1])<=26 and T[x]!="0":
c+=f(x+1)
if x+2<=n and 1<=int(T[x:x+2])<=26 and T[x]!="0":
c+=f(x+2)
return c
S=[]
l=0
while l<n:
c=f(l+1)
if K<=c:
S+=[int(T[l:l+1])]
l+=1
continue
K-=c
c=f(l+2)
S+=[int(T[l:l+2])]
l+=2
print("".join(chr(v-1+ord("a")) for v in S))
sasa8uyauya