結果

問題 No.1471 Sort Queries
ユーザー raven7959raven7959
提出日時 2021-10-12 08:49:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 174 ms / 2,000 ms
コード長 440 bytes
コンパイル時間 616 ms
コンパイル使用メモリ 86,924 KB
実行使用メモリ 81,264 KB
最終ジャッジ日時 2023-10-14 23:09:34
合計ジャッジ時間 8,077 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,204 KB
testcase_01 AC 74 ms
71,620 KB
testcase_02 AC 74 ms
71,204 KB
testcase_03 AC 81 ms
76,360 KB
testcase_04 AC 83 ms
76,312 KB
testcase_05 AC 81 ms
76,068 KB
testcase_06 AC 75 ms
71,320 KB
testcase_07 AC 79 ms
75,936 KB
testcase_08 AC 84 ms
76,376 KB
testcase_09 AC 79 ms
76,116 KB
testcase_10 AC 74 ms
71,340 KB
testcase_11 AC 81 ms
76,192 KB
testcase_12 AC 85 ms
76,200 KB
testcase_13 AC 151 ms
79,704 KB
testcase_14 AC 134 ms
79,876 KB
testcase_15 AC 139 ms
79,732 KB
testcase_16 AC 130 ms
77,920 KB
testcase_17 AC 131 ms
79,836 KB
testcase_18 AC 129 ms
79,576 KB
testcase_19 AC 130 ms
78,072 KB
testcase_20 AC 137 ms
79,576 KB
testcase_21 AC 131 ms
79,640 KB
testcase_22 AC 130 ms
79,576 KB
testcase_23 AC 143 ms
80,208 KB
testcase_24 AC 144 ms
80,064 KB
testcase_25 AC 153 ms
80,240 KB
testcase_26 AC 145 ms
79,856 KB
testcase_27 AC 148 ms
81,036 KB
testcase_28 AC 148 ms
80,808 KB
testcase_29 AC 146 ms
79,896 KB
testcase_30 AC 144 ms
80,008 KB
testcase_31 AC 152 ms
79,976 KB
testcase_32 AC 157 ms
80,104 KB
testcase_33 AC 174 ms
81,264 KB
testcase_34 AC 164 ms
81,236 KB
testcase_35 AC 163 ms
81,160 KB
testcase_36 AC 154 ms
81,100 KB
testcase_37 AC 155 ms
80,972 KB
testcase_38 AC 139 ms
80,568 KB
testcase_39 AC 162 ms
81,116 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_left
N,Q=map(int,input().split())
S=input()
nums=[[0]*26]
for s in S:
    res=[nums[-1][i] for i in range(26)]
    res[ord(s)-ord("a")]+=1
    nums.append(res)
for _ in range(Q):
    l,r,x=map(int,input().split())
    substring=[0]*26
    for i in range(26):
        substring[i]=nums[r][i]-nums[l-1][i]
    for i in range(25):
        substring[i+1]+=substring[i]
    print(chr(bisect_left(substring,x)+ord("a")))
0