結果

問題 No.1471 Sort Queries
ユーザー lie_of_lillielie_of_lillie
提出日時 2021-06-14 00:46:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 120 ms / 2,000 ms
コード長 508 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 10,784 KB
実行使用メモリ 11,716 KB
最終ジャッジ日時 2023-08-25 03:59:56
合計ジャッジ時間 4,779 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,820 KB
testcase_01 AC 16 ms
7,820 KB
testcase_02 AC 16 ms
7,764 KB
testcase_03 AC 16 ms
7,764 KB
testcase_04 AC 17 ms
7,900 KB
testcase_05 AC 16 ms
7,928 KB
testcase_06 AC 16 ms
7,792 KB
testcase_07 AC 17 ms
7,820 KB
testcase_08 AC 17 ms
7,760 KB
testcase_09 AC 16 ms
7,952 KB
testcase_10 AC 16 ms
7,820 KB
testcase_11 AC 16 ms
7,776 KB
testcase_12 AC 16 ms
7,928 KB
testcase_13 AC 43 ms
9,640 KB
testcase_14 AC 41 ms
9,356 KB
testcase_15 AC 57 ms
9,484 KB
testcase_16 AC 41 ms
8,600 KB
testcase_17 AC 37 ms
9,376 KB
testcase_18 AC 32 ms
9,400 KB
testcase_19 AC 40 ms
8,604 KB
testcase_20 AC 58 ms
9,592 KB
testcase_21 AC 41 ms
9,200 KB
testcase_22 AC 36 ms
9,324 KB
testcase_23 AC 73 ms
10,592 KB
testcase_24 AC 71 ms
10,740 KB
testcase_25 AC 96 ms
10,972 KB
testcase_26 AC 77 ms
10,020 KB
testcase_27 AC 83 ms
11,244 KB
testcase_28 AC 83 ms
11,180 KB
testcase_29 AC 75 ms
10,032 KB
testcase_30 AC 71 ms
10,648 KB
testcase_31 AC 100 ms
10,616 KB
testcase_32 AC 104 ms
9,948 KB
testcase_33 AC 113 ms
11,396 KB
testcase_34 AC 120 ms
11,464 KB
testcase_35 AC 116 ms
11,556 KB
testcase_36 AC 115 ms
11,416 KB
testcase_37 AC 112 ms
11,392 KB
testcase_38 AC 89 ms
11,716 KB
testcase_39 AC 114 ms
11,652 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,Q=map(int,input().split())
S=input()

cs = [None for i in range(len(S)+1)]
cs[0] = [0]*26
chidx = [0]*26

for i,s in enumerate(S, 1):
    chidx[ord(s) - ord('a')] += 1 # 文字の累積和
    cs[i] = chidx[:] # コピーする

que = []
for q in range(Q):
    l,r,x=map(int,input().split())
    diff = [ri-li for ri,li in zip(cs[r], cs[l-1])]
    tmp = 0
    for i, d in enumerate(diff, ord('a')):
        tmp += d
        if tmp >= x:
            que.append(chr(i))
            break
print(*que,sep='\n')
0