結果

問題 No.1471 Sort Queries
ユーザー stng
提出日時 2021-08-29 12:37:42
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 343 bytes
コンパイル時間 295 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 257,920 KB
最終ジャッジ日時 2024-11-22 05:01:08
合計ジャッジ時間 61,236 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20 TLE * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect

n,q = map(int,input().split())
s = input()
lrx = [[int(i)-1 for i in input().split()] for j in range(q)]

sli = [0]*(n)

for i in range(n):
    sli[i] = ord(s[i])
    
for i in range(q):
    l,r,x = lrx[i][0],lrx[i][1],lrx[i][2]
    tmp = []
    for j in range(r-l+1):
        bisect.insort(tmp,sli[l+j])
    print(chr(tmp[x]))
0