結果

問題 No.1471 Sort Queries
ユーザー 👑 H20H20
提出日時 2021-04-09 22:22:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 141 ms / 2,000 ms
コード長 433 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 87,000 KB
実行使用メモリ 82,384 KB
最終ジャッジ日時 2023-09-07 11:50:01
合計ジャッジ時間 6,264 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,560 KB
testcase_01 AC 73 ms
71,216 KB
testcase_02 AC 72 ms
71,436 KB
testcase_03 AC 78 ms
75,332 KB
testcase_04 AC 75 ms
71,560 KB
testcase_05 AC 74 ms
71,376 KB
testcase_06 AC 74 ms
71,548 KB
testcase_07 AC 74 ms
71,220 KB
testcase_08 AC 76 ms
76,228 KB
testcase_09 AC 72 ms
75,192 KB
testcase_10 AC 70 ms
71,584 KB
testcase_11 AC 72 ms
71,488 KB
testcase_12 AC 74 ms
75,344 KB
testcase_13 AC 106 ms
79,432 KB
testcase_14 AC 105 ms
79,384 KB
testcase_15 AC 110 ms
79,360 KB
testcase_16 AC 106 ms
77,784 KB
testcase_17 AC 103 ms
79,488 KB
testcase_18 AC 100 ms
79,432 KB
testcase_19 AC 101 ms
76,940 KB
testcase_20 AC 110 ms
79,616 KB
testcase_21 AC 105 ms
80,092 KB
testcase_22 AC 103 ms
79,272 KB
testcase_23 AC 127 ms
81,748 KB
testcase_24 AC 129 ms
81,692 KB
testcase_25 AC 136 ms
81,644 KB
testcase_26 AC 127 ms
79,820 KB
testcase_27 AC 135 ms
82,120 KB
testcase_28 AC 132 ms
82,160 KB
testcase_29 AC 125 ms
80,188 KB
testcase_30 AC 115 ms
80,320 KB
testcase_31 AC 138 ms
81,496 KB
testcase_32 AC 134 ms
79,816 KB
testcase_33 AC 136 ms
82,168 KB
testcase_34 AC 140 ms
82,276 KB
testcase_35 AC 141 ms
82,160 KB
testcase_36 AC 137 ms
82,176 KB
testcase_37 AC 141 ms
82,168 KB
testcase_38 AC 140 ms
82,384 KB
testcase_39 AC 123 ms
81,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
N,Q = map(int,input().split())
S = input()
L = []
for i in range(26):
    L.append([0]*N)

for i in range(N):
    L[ord(S[i])-97][i] = 1

ACL = []
for i in range(26):
    ACL.append(list(itertools.accumulate(L[i]))+[0])

for _ in range(Q):
    l,r,x=map(int,input().split())
    l-=1
    r-=1
    for i in range(26):
        x-=ACL[i][r]-ACL[i][l-1]
        if x<=0:
            print(chr(i+97))
            break


0