結果
| 問題 |
No.3290 Encrypt Failed, but Decrypt Succeeded
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-10-03 22:49:45 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 366 bytes |
| コンパイル時間 | 202 ms |
| コンパイル使用メモリ | 82,308 KB |
| 実行使用メモリ | 848,148 KB |
| 最終ジャッジ日時 | 2025-10-03 22:49:50 |
| 合計ジャッジ時間 | 4,360 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 4 WA * 16 MLE * 1 -- * 6 |
ソースコード
n,k=map(int,input().split())
t=input()
d=[0]*(1+n)
d[n]=1
for i in range(n)[::-1]:
if t[i]=='0':
continue
d[i]+=d[i+1]
if 10<int(t[i:i+2])<=26:
d[i]+=d[i+2]
i=0
ans=[]
while i<n:
# print(k,i,d[i+1])
if k<=d[i+1]:
ans+=chr(int(t[i])+ord('a')-1),
i+=1
else:
ans+=chr(int(t[i:i+2])+ord('a')-1),
k-=d[i+1]
i+=2
print(''.join(ans))