結果

問題 No.1471 Sort Queries
ユーザー DrDrpilotDrDrpilot
提出日時 2022-06-08 13:48:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 435 ms / 2,000 ms
コード長 438 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 11,812 KB
実行使用メモリ 14,832 KB
最終ジャッジ日時 2023-10-21 04:01:44
合計ジャッジ時間 8,528 ms
ジャッジサーバーID
(参考情報)
judge10 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,064 KB
testcase_01 AC 30 ms
10,064 KB
testcase_02 AC 30 ms
10,064 KB
testcase_03 AC 31 ms
10,064 KB
testcase_04 AC 31 ms
10,072 KB
testcase_05 AC 30 ms
10,064 KB
testcase_06 AC 30 ms
10,068 KB
testcase_07 AC 30 ms
10,068 KB
testcase_08 AC 32 ms
10,064 KB
testcase_09 AC 30 ms
10,072 KB
testcase_10 AC 30 ms
10,068 KB
testcase_11 AC 31 ms
10,068 KB
testcase_12 AC 32 ms
10,064 KB
testcase_13 AC 133 ms
11,004 KB
testcase_14 AC 126 ms
10,868 KB
testcase_15 AC 165 ms
10,912 KB
testcase_16 AC 94 ms
10,276 KB
testcase_17 AC 115 ms
10,928 KB
testcase_18 AC 100 ms
10,816 KB
testcase_19 AC 99 ms
10,356 KB
testcase_20 AC 171 ms
10,928 KB
testcase_21 AC 119 ms
10,820 KB
testcase_22 AC 107 ms
10,816 KB
testcase_23 AC 250 ms
12,512 KB
testcase_24 AC 245 ms
12,604 KB
testcase_25 AC 334 ms
13,036 KB
testcase_26 AC 224 ms
11,212 KB
testcase_27 AC 307 ms
14,656 KB
testcase_28 AC 312 ms
14,464 KB
testcase_29 AC 229 ms
11,268 KB
testcase_30 AC 246 ms
12,356 KB
testcase_31 AC 318 ms
11,936 KB
testcase_32 AC 310 ms
10,928 KB
testcase_33 AC 418 ms
14,832 KB
testcase_34 AC 435 ms
14,808 KB
testcase_35 AC 421 ms
14,804 KB
testcase_36 AC 377 ms
14,624 KB
testcase_37 AC 380 ms
14,624 KB
testcase_38 AC 311 ms
12,396 KB
testcase_39 AC 347 ms
14,260 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())
    ans=''
    for i in range(26):
        ans+=alp[i]*(cnt[i][r]-cnt[i][l-1])
    print(ans[x-1])
0