結果

問題 No.1471 Sort Queries
ユーザー Eki1009Eki1009
提出日時 2021-04-09 21:28:29
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 130 ms / 2,000 ms
コード長 398 bytes
コンパイル時間 426 ms
コンパイル使用メモリ 86,996 KB
実行使用メモリ 80,120 KB
最終ジャッジ日時 2023-09-07 09:54:15
合計ジャッジ時間 5,937 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,152 KB
testcase_01 AC 64 ms
71,308 KB
testcase_02 AC 66 ms
71,448 KB
testcase_03 AC 72 ms
76,336 KB
testcase_04 AC 67 ms
70,984 KB
testcase_05 AC 68 ms
71,088 KB
testcase_06 AC 64 ms
71,500 KB
testcase_07 AC 67 ms
71,440 KB
testcase_08 AC 72 ms
76,344 KB
testcase_09 AC 72 ms
76,076 KB
testcase_10 AC 70 ms
71,500 KB
testcase_11 AC 69 ms
70,988 KB
testcase_12 AC 73 ms
76,336 KB
testcase_13 AC 110 ms
76,604 KB
testcase_14 AC 92 ms
76,852 KB
testcase_15 AC 105 ms
76,976 KB
testcase_16 AC 94 ms
77,568 KB
testcase_17 AC 90 ms
76,892 KB
testcase_18 AC 86 ms
76,984 KB
testcase_19 AC 94 ms
76,924 KB
testcase_20 AC 104 ms
76,884 KB
testcase_21 AC 97 ms
77,268 KB
testcase_22 AC 95 ms
76,872 KB
testcase_23 AC 129 ms
79,164 KB
testcase_24 AC 116 ms
79,192 KB
testcase_25 AC 119 ms
79,420 KB
testcase_26 AC 114 ms
78,680 KB
testcase_27 AC 118 ms
79,332 KB
testcase_28 AC 122 ms
79,524 KB
testcase_29 AC 112 ms
78,964 KB
testcase_30 AC 104 ms
78,948 KB
testcase_31 AC 130 ms
79,060 KB
testcase_32 AC 126 ms
78,708 KB
testcase_33 AC 127 ms
79,536 KB
testcase_34 AC 126 ms
79,636 KB
testcase_35 AC 129 ms
79,364 KB
testcase_36 AC 124 ms
79,512 KB
testcase_37 AC 118 ms
79,672 KB
testcase_38 AC 126 ms
80,120 KB
testcase_39 AC 114 ms
79,440 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, q = map(int, input().split())
S = input()
d = 26
C = [[0]*(n+1) for _ in range(d)]
for i, s in enumerate(S):
    for j in range(d):
        C[j][i+1] += C[j][i]
    c = ord(s) - ord('a')
    C[c][i+1] += 1
for _ in range(q):
    l, r, x = map(int, input().split())
    l -= 1
    for j in range(d):
        x -= C[j][r] - C[j][l]
        if x <= 0:
            break
    print(chr(j + ord('a')))
0