結果

問題 No.1471 Sort Queries
ユーザー DrDrpilotDrDrpilot
提出日時 2022-06-08 13:51:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 116 ms / 2,000 ms
コード長 471 bytes
コンパイル時間 219 ms
コンパイル使用メモリ 81,708 KB
実行使用メモリ 78,420 KB
最終ジャッジ日時 2023-10-21 04:01:57
合計ジャッジ時間 4,680 ms
ジャッジサーバーID
(参考情報)
judge10 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,372 KB
testcase_01 AC 39 ms
53,372 KB
testcase_02 AC 40 ms
53,372 KB
testcase_03 AC 46 ms
59,568 KB
testcase_04 AC 42 ms
53,372 KB
testcase_05 AC 41 ms
53,372 KB
testcase_06 AC 39 ms
53,372 KB
testcase_07 AC 45 ms
53,372 KB
testcase_08 AC 47 ms
59,784 KB
testcase_09 AC 45 ms
59,568 KB
testcase_10 AC 40 ms
53,372 KB
testcase_11 AC 41 ms
53,372 KB
testcase_12 AC 49 ms
61,908 KB
testcase_13 AC 77 ms
70,732 KB
testcase_14 AC 74 ms
70,728 KB
testcase_15 AC 83 ms
72,780 KB
testcase_16 AC 74 ms
71,344 KB
testcase_17 AC 73 ms
68,680 KB
testcase_18 AC 69 ms
68,680 KB
testcase_19 AC 75 ms
70,736 KB
testcase_20 AC 81 ms
72,780 KB
testcase_21 AC 74 ms
71,344 KB
testcase_22 AC 72 ms
68,680 KB
testcase_23 AC 102 ms
77,748 KB
testcase_24 AC 103 ms
77,824 KB
testcase_25 AC 111 ms
77,828 KB
testcase_26 AC 103 ms
77,356 KB
testcase_27 AC 106 ms
77,996 KB
testcase_28 AC 106 ms
77,960 KB
testcase_29 AC 103 ms
77,424 KB
testcase_30 AC 88 ms
73,528 KB
testcase_31 AC 110 ms
77,424 KB
testcase_32 AC 111 ms
77,300 KB
testcase_33 AC 112 ms
78,020 KB
testcase_34 AC 116 ms
78,024 KB
testcase_35 AC 116 ms
78,024 KB
testcase_36 AC 110 ms
78,172 KB
testcase_37 AC 109 ms
78,024 KB
testcase_38 AC 114 ms
78,420 KB
testcase_39 AC 97 ms
77,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

alp='abcdefghijklmnopqrstuvwxyz'
n,q=map(int,input().split())
s=input()
cnt=[[0]*(n+1) for _ in range(26)]
for i in range(26):
    ch=alp[i]
    for j in range(n):
        if s[j]==ch:
            cnt[i][j+1]+=1
for i in range(26):
    for j in range(n):
        cnt[i][j+1]+=cnt[i][j]
for _ in range(q):
    l,r,x=map(int,input().split())
    tmp=0
    for i in range(26):
        tmp+=cnt[i][r]-cnt[i][l-1]
        if tmp>=x:
            print(alp[i])
            break
0