結果

問題 No.1471 Sort Queries
ユーザー otsunekootsuneko
提出日時 2021-05-04 13:49:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 144 ms / 2,000 ms
コード長 449 bytes
コンパイル時間 309 ms
コンパイル使用メモリ 87,152 KB
実行使用メモリ 81,340 KB
最終ジャッジ日時 2023-09-30 15:09:46
合計ジャッジ時間 7,293 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,196 KB
testcase_01 AC 76 ms
71,396 KB
testcase_02 AC 76 ms
71,544 KB
testcase_03 AC 76 ms
71,408 KB
testcase_04 AC 78 ms
71,396 KB
testcase_05 AC 77 ms
71,304 KB
testcase_06 AC 75 ms
71,456 KB
testcase_07 AC 76 ms
71,628 KB
testcase_08 AC 80 ms
75,756 KB
testcase_09 AC 76 ms
71,628 KB
testcase_10 AC 76 ms
71,480 KB
testcase_11 AC 76 ms
71,548 KB
testcase_12 AC 77 ms
71,568 KB
testcase_13 AC 108 ms
77,024 KB
testcase_14 AC 106 ms
76,988 KB
testcase_15 AC 117 ms
78,996 KB
testcase_16 AC 105 ms
77,700 KB
testcase_17 AC 101 ms
76,984 KB
testcase_18 AC 101 ms
77,044 KB
testcase_19 AC 106 ms
77,128 KB
testcase_20 AC 113 ms
79,084 KB
testcase_21 AC 104 ms
77,760 KB
testcase_22 AC 104 ms
77,152 KB
testcase_23 AC 130 ms
80,248 KB
testcase_24 AC 129 ms
80,256 KB
testcase_25 AC 137 ms
80,388 KB
testcase_26 AC 130 ms
80,032 KB
testcase_27 AC 133 ms
81,004 KB
testcase_28 AC 133 ms
80,896 KB
testcase_29 AC 127 ms
79,816 KB
testcase_30 AC 119 ms
80,124 KB
testcase_31 AC 136 ms
79,980 KB
testcase_32 AC 138 ms
79,460 KB
testcase_33 AC 140 ms
81,340 KB
testcase_34 AC 143 ms
81,020 KB
testcase_35 AC 141 ms
80,884 KB
testcase_36 AC 138 ms
81,176 KB
testcase_37 AC 138 ms
80,884 KB
testcase_38 AC 144 ms
80,960 KB
testcase_39 AC 127 ms
80,596 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

alpha = [0]*26
cumsum = [alpha[:]]
for s in S:
    idx = ord(s)-97
    alpha[idx] += 1
    cumsum.append(alpha[:])

for _ in range(Q):
    l,r,x = map(int,input().split())

    chr_list = [0]*26

    cnt = 0
    for i in range(26):
        chr_list[i] = cumsum[r][i] - cumsum[l-1][i]
        cnt += chr_list[i]
        if cnt >= x:
            print(chr(97+i))
            break
0