結果

問題 No.1471 Sort Queries
ユーザー NoaSaberNoaSaber
提出日時 2021-04-26 10:16:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 368 ms / 2,000 ms
コード長 462 bytes
コンパイル時間 1,002 ms
コンパイル使用メモリ 86,900 KB
実行使用メモリ 93,232 KB
最終ジャッジ日時 2023-09-18 01:56:28
合計ジャッジ時間 12,544 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
72,560 KB
testcase_01 AC 110 ms
72,360 KB
testcase_02 AC 111 ms
72,700 KB
testcase_03 AC 134 ms
77,756 KB
testcase_04 AC 120 ms
77,344 KB
testcase_05 AC 112 ms
72,408 KB
testcase_06 AC 110 ms
72,728 KB
testcase_07 AC 113 ms
72,624 KB
testcase_08 AC 133 ms
77,384 KB
testcase_09 AC 115 ms
72,628 KB
testcase_10 AC 114 ms
72,724 KB
testcase_11 AC 115 ms
75,824 KB
testcase_12 AC 132 ms
77,504 KB
testcase_13 AC 260 ms
85,704 KB
testcase_14 AC 253 ms
86,360 KB
testcase_15 AC 291 ms
87,444 KB
testcase_16 AC 231 ms
81,724 KB
testcase_17 AC 250 ms
87,084 KB
testcase_18 AC 249 ms
86,020 KB
testcase_19 AC 245 ms
83,888 KB
testcase_20 AC 275 ms
86,868 KB
testcase_21 AC 254 ms
86,212 KB
testcase_22 AC 251 ms
86,448 KB
testcase_23 AC 324 ms
90,724 KB
testcase_24 AC 315 ms
89,644 KB
testcase_25 AC 344 ms
91,856 KB
testcase_26 AC 314 ms
88,036 KB
testcase_27 AC 341 ms
92,740 KB
testcase_28 AC 336 ms
92,568 KB
testcase_29 AC 303 ms
88,384 KB
testcase_30 AC 311 ms
90,484 KB
testcase_31 AC 328 ms
89,604 KB
testcase_32 AC 337 ms
87,968 KB
testcase_33 AC 352 ms
92,640 KB
testcase_34 AC 368 ms
93,232 KB
testcase_35 AC 360 ms
93,052 KB
testcase_36 AC 321 ms
92,664 KB
testcase_37 AC 319 ms
92,872 KB
testcase_38 AC 260 ms
85,936 KB
testcase_39 AC 288 ms
88,140 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,Q=map(int,input().split())
S=input()
from collections import Counter
from copy import deepcopy
cum=[Counter() for i in range(N+1)]
for i in range(N):
    cum[i+1]=deepcopy(cum[i])
    cum[i+1][S[i]]+=1
a_l=[chr(i) for i in range(97, 97+26)]
for i in range(Q):
    L,R,X=map(int,input().split())
    tmp_c=cum[R]-cum[L-1]
    tmp=0
    for j in a_l:
        if tmp<=X<=tmp+tmp_c[j]:
            print(j)
            break
        else:
            tmp+=tmp_c[j]
0