結果

問題 No.1471 Sort Queries
ユーザー 👑 KazunKazun
提出日時 2021-04-09 21:34:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 192 ms / 2,000 ms
コード長 476 bytes
コンパイル時間 1,829 ms
コンパイル使用メモリ 86,792 KB
実行使用メモリ 84,756 KB
最終ジャッジ日時 2023-09-07 10:11:36
合計ジャッジ時間 9,956 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 146 ms
80,048 KB
testcase_01 AC 145 ms
80,116 KB
testcase_02 AC 145 ms
79,972 KB
testcase_03 AC 156 ms
80,900 KB
testcase_04 AC 153 ms
79,968 KB
testcase_05 AC 149 ms
79,748 KB
testcase_06 AC 146 ms
80,016 KB
testcase_07 AC 145 ms
80,020 KB
testcase_08 AC 159 ms
81,192 KB
testcase_09 AC 148 ms
80,724 KB
testcase_10 AC 143 ms
79,904 KB
testcase_11 AC 140 ms
79,740 KB
testcase_12 AC 148 ms
81,428 KB
testcase_13 AC 165 ms
81,700 KB
testcase_14 AC 159 ms
81,804 KB
testcase_15 AC 164 ms
81,540 KB
testcase_16 AC 165 ms
81,748 KB
testcase_17 AC 156 ms
81,804 KB
testcase_18 AC 156 ms
81,736 KB
testcase_19 AC 156 ms
81,396 KB
testcase_20 AC 164 ms
81,472 KB
testcase_21 AC 150 ms
81,648 KB
testcase_22 AC 155 ms
81,420 KB
testcase_23 AC 175 ms
84,100 KB
testcase_24 AC 171 ms
83,812 KB
testcase_25 AC 177 ms
84,576 KB
testcase_26 AC 176 ms
84,024 KB
testcase_27 AC 179 ms
84,508 KB
testcase_28 AC 180 ms
84,492 KB
testcase_29 AC 175 ms
83,624 KB
testcase_30 AC 165 ms
81,724 KB
testcase_31 AC 179 ms
83,968 KB
testcase_32 AC 180 ms
83,912 KB
testcase_33 AC 178 ms
84,392 KB
testcase_34 AC 182 ms
84,580 KB
testcase_35 AC 192 ms
84,440 KB
testcase_36 AC 178 ms
84,756 KB
testcase_37 AC 177 ms
84,700 KB
testcase_38 AC 160 ms
81,672 KB
testcase_39 AC 173 ms
84,588 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from string import ascii_lowercase as ALPHABET

input=sys.stdin.readline

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

T={x:[0]*(N+1) for x in ALPHABET}

for x in ALPHABET:
    U=T[x]
    for i in range(1,N+1):
        if S[i]==x:
            U[i]=U[i-1]+1
        else:
            U[i]=U[i-1]

for _ in range(Q):
    L,R,X=map(int,input().split())

    K=0
    for x in ALPHABET:
        K+=T[x][R]-T[x][L-1]
        if K>=X:
            print(x)
            break
0