結果

問題 No.1471 Sort Queries
ユーザー 330Xs330Xs
提出日時 2022-02-03 16:53:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 202 ms / 2,000 ms
コード長 538 bytes
コンパイル時間 300 ms
コンパイル使用メモリ 87,220 KB
実行使用メモリ 82,208 KB
最終ジャッジ日時 2023-09-02 03:19:47
合計ジャッジ時間 7,812 ms
ジャッジサーバーID
(参考情報)
judge16 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
71,880 KB
testcase_01 AC 92 ms
71,812 KB
testcase_02 AC 95 ms
71,680 KB
testcase_03 AC 103 ms
77,348 KB
testcase_04 AC 96 ms
71,676 KB
testcase_05 AC 96 ms
71,640 KB
testcase_06 AC 94 ms
71,880 KB
testcase_07 AC 94 ms
71,480 KB
testcase_08 AC 107 ms
77,696 KB
testcase_09 AC 102 ms
77,348 KB
testcase_10 AC 94 ms
71,876 KB
testcase_11 AC 95 ms
71,636 KB
testcase_12 AC 104 ms
77,560 KB
testcase_13 AC 144 ms
79,436 KB
testcase_14 AC 141 ms
79,548 KB
testcase_15 AC 151 ms
79,508 KB
testcase_16 AC 136 ms
78,800 KB
testcase_17 AC 140 ms
79,464 KB
testcase_18 AC 137 ms
79,552 KB
testcase_19 AC 136 ms
78,372 KB
testcase_20 AC 151 ms
79,740 KB
testcase_21 AC 141 ms
79,632 KB
testcase_22 AC 142 ms
79,484 KB
testcase_23 AC 179 ms
80,568 KB
testcase_24 AC 176 ms
80,564 KB
testcase_25 AC 187 ms
80,776 KB
testcase_26 AC 173 ms
80,280 KB
testcase_27 AC 185 ms
81,392 KB
testcase_28 AC 183 ms
81,636 KB
testcase_29 AC 169 ms
80,140 KB
testcase_30 AC 165 ms
80,316 KB
testcase_31 AC 183 ms
80,884 KB
testcase_32 AC 178 ms
80,628 KB
testcase_33 AC 194 ms
81,504 KB
testcase_34 AC 200 ms
81,536 KB
testcase_35 AC 202 ms
81,372 KB
testcase_36 AC 190 ms
81,496 KB
testcase_37 AC 187 ms
81,436 KB
testcase_38 AC 189 ms
82,208 KB
testcase_39 AC 176 ms
81,476 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
n,m = map(int,input().split())
s = list(map(str,input()))
ss = sorted(s)
d = defaultdict(list)
for i in range(26):
    d[chr(97+i)].append(0)
    for j in range(n):
        if(s[j] == chr(97+i)):
            d[chr(97+i)].append(d[chr(97+i)][-1] + 1)
        else:
            d[chr(97+i)].append(d[chr(97+i)][-1])

for _ in range(m):
    a,b,c = map(int,input().split())
    cnt = 0
    for key in d:
        cnt += d[key][b] - d[key][a-1]
        if(cnt >= c):
            print(key)
            break
0