結果

問題 No.3290 Encrypt Failed, but Decrypt Succeeded
ユーザー moon17
提出日時 2025-10-03 22:59:58
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 382 bytes
コンパイル時間 306 ms
コンパイル使用メモリ 82,316 KB
実行使用メモリ 849,004 KB
最終ジャッジ日時 2025-10-03 23:00:02
合計ジャッジ時間 3,456 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10 MLE * 1 -- * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k=map(int,input().split())
t=[*map(int,input())]
d=[0]*(1+n)
d[n]=1
for i in range(n)[::-1]:
  if t[i]==0:
    continue
  if i+1>=n or t[i+1]:
    d[i]+=d[i+1]
  if i+1<n and 10<=t[i]*10+t[i+1]<=26:
    d[i]+=d[i+2]
i=0
a='0abcdefghijklmnopqrstuvwxyz'
while i<n:
  if k<=d[i+1]:
    print(a[t[i]],end='')
    i+=1
  else:
    print(a[t[i]*10+t[i+1]],end='')
    k-=d[i+1]
    i+=2
0