結果

問題 No.1471 Sort Queries
ユーザー ああいいああいい
提出日時 2021-12-28 22:54:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 249 ms / 2,000 ms
コード長 447 bytes
コンパイル時間 246 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 16,256 KB
最終ジャッジ日時 2024-04-10 15:12:47
合計ジャッジ時間 5,737 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
10,752 KB
testcase_01 AC 25 ms
10,880 KB
testcase_02 AC 25 ms
10,880 KB
testcase_03 AC 25 ms
10,880 KB
testcase_04 AC 25 ms
10,752 KB
testcase_05 AC 24 ms
10,752 KB
testcase_06 AC 24 ms
10,752 KB
testcase_07 AC 24 ms
10,880 KB
testcase_08 AC 26 ms
10,880 KB
testcase_09 AC 25 ms
10,752 KB
testcase_10 AC 25 ms
10,752 KB
testcase_11 AC 25 ms
10,880 KB
testcase_12 AC 26 ms
10,880 KB
testcase_13 AC 88 ms
12,160 KB
testcase_14 AC 84 ms
11,776 KB
testcase_15 AC 116 ms
12,032 KB
testcase_16 AC 70 ms
11,008 KB
testcase_17 AC 76 ms
11,904 KB
testcase_18 AC 66 ms
11,776 KB
testcase_19 AC 73 ms
11,136 KB
testcase_20 AC 119 ms
12,032 KB
testcase_21 AC 83 ms
11,904 KB
testcase_22 AC 77 ms
11,776 KB
testcase_23 AC 161 ms
13,952 KB
testcase_24 AC 159 ms
13,824 KB
testcase_25 AC 200 ms
14,464 KB
testcase_26 AC 149 ms
12,288 KB
testcase_27 AC 183 ms
16,128 KB
testcase_28 AC 188 ms
16,000 KB
testcase_29 AC 159 ms
12,416 KB
testcase_30 AC 162 ms
13,568 KB
testcase_31 AC 200 ms
13,056 KB
testcase_32 AC 210 ms
12,288 KB
testcase_33 AC 247 ms
16,256 KB
testcase_34 AC 247 ms
16,256 KB
testcase_35 AC 249 ms
16,256 KB
testcase_36 AC 242 ms
16,256 KB
testcase_37 AC 238 ms
16,128 KB
testcase_38 AC 209 ms
13,824 KB
testcase_39 AC 238 ms
15,616 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,Q = map(int,input().split())
S = input()
dat = [[0] * 26 for _ in range(N + 1)]

for i in range(1,N + 1):
    a = ord(S[i-1]) - ord('a')
    dat[i][a] += 1
    for j in range(26):
        dat[i][j] += dat[i-1][j]
u = [0] * 26
for _ in range(Q):
    l,r,x = map(int,input().split())
    for i in range(26):
        u[i] = dat[r][i] - dat[l-1][i]
    i = 0
    s = 0
    while s < x:
        s += u[i]
        i += 1
    print(chr(i-1 + ord('a')))
0