結果

問題 No.1471 Sort Queries
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2021-04-09 21:36:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 145 ms / 2,000 ms
コード長 394 bytes
コンパイル時間 522 ms
コンパイル使用メモリ 86,888 KB
実行使用メモリ 80,692 KB
最終ジャッジ日時 2023-09-07 10:16:15
合計ジャッジ時間 6,469 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,264 KB
testcase_01 AC 74 ms
70,996 KB
testcase_02 AC 74 ms
71,396 KB
testcase_03 AC 81 ms
76,520 KB
testcase_04 AC 76 ms
71,396 KB
testcase_05 AC 74 ms
71,224 KB
testcase_06 AC 74 ms
71,248 KB
testcase_07 AC 76 ms
71,100 KB
testcase_08 AC 85 ms
76,452 KB
testcase_09 AC 80 ms
76,416 KB
testcase_10 AC 76 ms
71,420 KB
testcase_11 AC 78 ms
71,248 KB
testcase_12 AC 81 ms
76,448 KB
testcase_13 AC 106 ms
76,792 KB
testcase_14 AC 104 ms
76,852 KB
testcase_15 AC 116 ms
78,532 KB
testcase_16 AC 107 ms
77,500 KB
testcase_17 AC 102 ms
76,624 KB
testcase_18 AC 101 ms
76,964 KB
testcase_19 AC 103 ms
76,840 KB
testcase_20 AC 110 ms
76,620 KB
testcase_21 AC 104 ms
77,404 KB
testcase_22 AC 103 ms
77,008 KB
testcase_23 AC 129 ms
80,080 KB
testcase_24 AC 129 ms
79,864 KB
testcase_25 AC 136 ms
80,032 KB
testcase_26 AC 131 ms
79,148 KB
testcase_27 AC 133 ms
80,392 KB
testcase_28 AC 132 ms
80,340 KB
testcase_29 AC 128 ms
79,236 KB
testcase_30 AC 120 ms
79,520 KB
testcase_31 AC 135 ms
79,648 KB
testcase_32 AC 137 ms
79,060 KB
testcase_33 AC 143 ms
80,436 KB
testcase_34 AC 144 ms
80,412 KB
testcase_35 AC 144 ms
80,388 KB
testcase_36 AC 139 ms
80,344 KB
testcase_37 AC 138 ms
80,524 KB
testcase_38 AC 145 ms
80,692 KB
testcase_39 AC 129 ms
80,200 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,q = map(int,input().split())
S = input()
dp = [[0]*26]
for s in S:
    ndp = [0]*26
    ndp[ord(s)-ord("a")] += 1
    for i in range(26):
        ndp[i] += dp[-1][i]
    dp.append(ndp)

for i in range(q):
    l,r,x = map(int,input().split())
    count = 0
    for j in range(26):
        count += dp[r][j]-dp[l-1][j]
        if count >= x:
            print(chr(ord("a")+j))
            break
0