結果

問題 No.1471 Sort Queries
ユーザー 👑 obakyanobakyan
提出日時 2021-05-04 21:38:25
言語 Lua
(LuaJit 2.1.1696795921)
結果
AC  
実行時間 17 ms / 2,000 ms
コード長 315 bytes
コンパイル時間 308 ms
コンパイル使用メモリ 5,332 KB
実行使用メモリ 7,992 KB
最終ジャッジ日時 2023-09-30 23:14:52
合計ジャッジ時間 2,545 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 6 ms
4,548 KB
testcase_14 AC 4 ms
4,376 KB
testcase_15 AC 7 ms
4,556 KB
testcase_16 AC 4 ms
4,380 KB
testcase_17 AC 6 ms
4,516 KB
testcase_18 AC 4 ms
4,380 KB
testcase_19 AC 4 ms
4,380 KB
testcase_20 AC 7 ms
4,516 KB
testcase_21 AC 4 ms
4,380 KB
testcase_22 AC 4 ms
4,376 KB
testcase_23 AC 9 ms
4,504 KB
testcase_24 AC 9 ms
4,612 KB
testcase_25 AC 15 ms
7,772 KB
testcase_26 AC 9 ms
4,504 KB
testcase_27 AC 13 ms
7,528 KB
testcase_28 AC 14 ms
7,628 KB
testcase_29 AC 9 ms
4,436 KB
testcase_30 AC 9 ms
4,516 KB
testcase_31 AC 12 ms
4,444 KB
testcase_32 AC 12 ms
4,412 KB
testcase_33 AC 16 ms
7,880 KB
testcase_34 AC 17 ms
7,896 KB
testcase_35 AC 17 ms
7,792 KB
testcase_36 AC 15 ms
7,800 KB
testcase_37 AC 16 ms
7,872 KB
testcase_38 AC 15 ms
7,992 KB
testcase_39 AC 16 ms
7,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,q,_,s=io.read("*n","*n","*l","*l")
t={}
for i=1,26 do t[i]={0} end
for i=1,n do for j=1,26 do if s:byte(i)-96==j then t[j][i+1]=t[j][i]+1 else t[j][i+1]=t[j][i] end end end
for w=1,q do l,r,x=io.read("*n","*n","*n") for i=1,26 do z = t[i][r+1]-t[i][l] if x<=z then print(string.char(96+i)) break end x=x-z end end
0