結果

問題 No.1471 Sort Queries
ユーザー 8nd5t8nd5t
提出日時 2021-04-09 21:40:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 155 ms / 2,000 ms
コード長 870 bytes
コンパイル時間 1,127 ms
コンパイル使用メモリ 86,812 KB
実行使用メモリ 81,740 KB
最終ジャッジ日時 2023-09-07 10:26:32
合計ジャッジ時間 7,932 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 99 ms
71,820 KB
testcase_01 AC 98 ms
71,532 KB
testcase_02 AC 99 ms
71,312 KB
testcase_03 AC 108 ms
77,196 KB
testcase_04 AC 102 ms
72,156 KB
testcase_05 AC 98 ms
71,700 KB
testcase_06 AC 100 ms
71,608 KB
testcase_07 AC 101 ms
71,460 KB
testcase_08 AC 108 ms
77,344 KB
testcase_09 AC 104 ms
76,748 KB
testcase_10 AC 98 ms
71,412 KB
testcase_11 AC 101 ms
72,096 KB
testcase_12 AC 107 ms
77,160 KB
testcase_13 AC 128 ms
77,952 KB
testcase_14 AC 129 ms
78,068 KB
testcase_15 AC 134 ms
78,196 KB
testcase_16 AC 128 ms
78,412 KB
testcase_17 AC 131 ms
78,388 KB
testcase_18 AC 130 ms
78,364 KB
testcase_19 AC 129 ms
78,356 KB
testcase_20 AC 132 ms
78,348 KB
testcase_21 AC 129 ms
78,540 KB
testcase_22 AC 127 ms
78,400 KB
testcase_23 AC 141 ms
78,376 KB
testcase_24 AC 138 ms
78,032 KB
testcase_25 AC 148 ms
80,436 KB
testcase_26 AC 148 ms
79,692 KB
testcase_27 AC 151 ms
81,348 KB
testcase_28 AC 145 ms
81,740 KB
testcase_29 AC 134 ms
78,312 KB
testcase_30 AC 132 ms
78,024 KB
testcase_31 AC 142 ms
80,392 KB
testcase_32 AC 139 ms
79,900 KB
testcase_33 AC 147 ms
81,572 KB
testcase_34 AC 155 ms
80,916 KB
testcase_35 AC 150 ms
81,244 KB
testcase_36 AC 146 ms
80,900 KB
testcase_37 AC 147 ms
81,056 KB
testcase_38 AC 145 ms
81,264 KB
testcase_39 AC 140 ms
80,952 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys,math,itertools
from collections import Counter,deque,defaultdict
from bisect import bisect_left,bisect_right 
from heapq import heappop,heappush,heapify
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_1(): return list(map(lambda x:int(x)-1, sys.stdin.readline().split()))
def inps(): return sys.stdin.readline()
def inpsl(x): tmp = inps(); return list(tmp[:x])
def err(x): print(x); exit()

n,q = inpl()
s = input()
ac = [[0]*26 for _ in range(n+1)]
for i,x in enumerate(s):
    for j in range(26):
        tmp = 1 if 97+j == ord(x) else 0
        ac[i+1][j] = ac[i][j] + tmp

for _ in range(q):
    l,r,X = inpl()
    cnt = 0
    for j in range(26):
        cnt += ac[r][j] - ac[l-1][j]
        if cnt >= X:
            print(chr(97+j))
            break

0