結果

問題 No.1471 Sort Queries
ユーザー netyo715netyo715
提出日時 2021-04-09 22:12:45
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 211 ms / 2,000 ms
コード長 483 bytes
コンパイル時間 142 ms
コンパイル使用メモリ 10,900 KB
実行使用メモリ 13,128 KB
最終ジャッジ日時 2023-09-07 11:36:18
合計ジャッジ時間 5,581 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,776 KB
testcase_01 AC 16 ms
7,880 KB
testcase_02 AC 16 ms
7,880 KB
testcase_03 AC 17 ms
7,756 KB
testcase_04 AC 17 ms
7,748 KB
testcase_05 AC 16 ms
7,756 KB
testcase_06 AC 16 ms
7,692 KB
testcase_07 AC 16 ms
7,756 KB
testcase_08 AC 17 ms
7,776 KB
testcase_09 AC 16 ms
7,820 KB
testcase_10 AC 17 ms
7,696 KB
testcase_11 AC 16 ms
7,776 KB
testcase_12 AC 18 ms
7,860 KB
testcase_13 AC 81 ms
9,112 KB
testcase_14 AC 74 ms
8,944 KB
testcase_15 AC 92 ms
9,080 KB
testcase_16 AC 49 ms
8,184 KB
testcase_17 AC 70 ms
9,028 KB
testcase_18 AC 61 ms
8,768 KB
testcase_19 AC 53 ms
8,580 KB
testcase_20 AC 95 ms
9,264 KB
testcase_21 AC 70 ms
8,624 KB
testcase_22 AC 67 ms
8,744 KB
testcase_23 AC 142 ms
10,900 KB
testcase_24 AC 139 ms
10,728 KB
testcase_25 AC 172 ms
11,216 KB
testcase_26 AC 121 ms
9,508 KB
testcase_27 AC 175 ms
12,812 KB
testcase_28 AC 176 ms
12,388 KB
testcase_29 AC 123 ms
9,496 KB
testcase_30 AC 137 ms
10,572 KB
testcase_31 AC 164 ms
10,140 KB
testcase_32 AC 151 ms
9,352 KB
testcase_33 AC 203 ms
13,100 KB
testcase_34 AC 211 ms
13,008 KB
testcase_35 AC 208 ms
12,936 KB
testcase_36 AC 196 ms
13,128 KB
testcase_37 AC 202 ms
12,964 KB
testcase_38 AC 149 ms
10,688 KB
testcase_39 AC 201 ms
12,532 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

alp = [chr(ord("a")+i) for i in range(26)]
rui = {alp[i]: [0]*(N+1) for i in range(26)}

for i in range(N):
    for a in alp:
        if S[i]==a:
            rui[a][i] += 1
        rui[a][i] += rui[a][i-1]

anss = []
for _ in range(Q):
    L, R, X = map(int, input().split())
    c = 0
    for a in alp:
        c += rui[a][R-1]-rui[a][L-2]
        if c >= X:
            anss.append(a)
            break

for ans in anss:
    print(ans)
0