結果

問題 No.1471 Sort Queries
ユーザー convexineqconvexineq
提出日時 2021-04-09 21:35:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 141 ms / 2,000 ms
コード長 363 bytes
コンパイル時間 533 ms
コンパイル使用メモリ 86,944 KB
実行使用メモリ 80,116 KB
最終ジャッジ日時 2023-09-07 10:12:37
合計ジャッジ時間 6,412 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,168 KB
testcase_01 AC 75 ms
71,364 KB
testcase_02 AC 73 ms
71,292 KB
testcase_03 AC 77 ms
76,340 KB
testcase_04 AC 73 ms
71,292 KB
testcase_05 AC 71 ms
71,480 KB
testcase_06 AC 70 ms
71,264 KB
testcase_07 AC 72 ms
71,260 KB
testcase_08 AC 80 ms
76,308 KB
testcase_09 AC 78 ms
76,160 KB
testcase_10 AC 73 ms
71,464 KB
testcase_11 AC 75 ms
71,368 KB
testcase_12 AC 79 ms
76,384 KB
testcase_13 AC 104 ms
76,900 KB
testcase_14 AC 102 ms
76,940 KB
testcase_15 AC 110 ms
77,108 KB
testcase_16 AC 103 ms
77,480 KB
testcase_17 AC 100 ms
76,860 KB
testcase_18 AC 97 ms
76,932 KB
testcase_19 AC 101 ms
76,772 KB
testcase_20 AC 110 ms
76,868 KB
testcase_21 AC 103 ms
77,388 KB
testcase_22 AC 102 ms
76,992 KB
testcase_23 AC 125 ms
79,148 KB
testcase_24 AC 126 ms
79,172 KB
testcase_25 AC 134 ms
79,204 KB
testcase_26 AC 124 ms
78,748 KB
testcase_27 AC 130 ms
79,656 KB
testcase_28 AC 130 ms
79,524 KB
testcase_29 AC 126 ms
78,748 KB
testcase_30 AC 115 ms
79,040 KB
testcase_31 AC 133 ms
79,064 KB
testcase_32 AC 136 ms
78,720 KB
testcase_33 AC 137 ms
79,616 KB
testcase_34 AC 141 ms
79,388 KB
testcase_35 AC 139 ms
79,680 KB
testcase_36 AC 130 ms
79,580 KB
testcase_37 AC 132 ms
79,628 KB
testcase_38 AC 139 ms
80,116 KB
testcase_39 AC 123 ms
79,408 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,Q = map(int,input().split())
s = input()
r = [[0]*(n+1) for _ in range(26)]
for i in range(n)[::-1]:
    for j in range(26):
        r[j][i] = r[j][i+1]
    v = ord(s[i])- 97
    r[v][i] += 1

for _ in range(Q):
    L,R,x = map(int,input().split())
    v = 0
    for i in range(26):
        v += r[i][L-1] - r[i][R]
        if v >= x: break
    print(chr(97+i))
0