結果

問題 No.1471 Sort Queries
ユーザー 👑 rin204rin204
提出日時 2022-01-18 04:17:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 113 ms / 2,000 ms
コード長 383 bytes
コンパイル時間 326 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 79,488 KB
最終ジャッジ日時 2024-05-02 19:15:51
合計ジャッジ時間 4,771 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
51,712 KB
testcase_01 AC 34 ms
52,096 KB
testcase_02 AC 35 ms
51,968 KB
testcase_03 AC 39 ms
52,480 KB
testcase_04 AC 40 ms
52,352 KB
testcase_05 AC 43 ms
52,480 KB
testcase_06 AC 36 ms
51,712 KB
testcase_07 AC 35 ms
52,096 KB
testcase_08 AC 39 ms
58,496 KB
testcase_09 AC 46 ms
52,096 KB
testcase_10 AC 35 ms
51,968 KB
testcase_11 AC 36 ms
52,352 KB
testcase_12 AC 35 ms
52,864 KB
testcase_13 AC 73 ms
71,552 KB
testcase_14 AC 71 ms
70,528 KB
testcase_15 AC 85 ms
73,344 KB
testcase_16 AC 74 ms
71,296 KB
testcase_17 AC 67 ms
70,528 KB
testcase_18 AC 65 ms
69,120 KB
testcase_19 AC 71 ms
69,248 KB
testcase_20 AC 75 ms
73,088 KB
testcase_21 AC 70 ms
72,448 KB
testcase_22 AC 66 ms
69,888 KB
testcase_23 AC 91 ms
78,336 KB
testcase_24 AC 95 ms
78,720 KB
testcase_25 AC 100 ms
78,720 KB
testcase_26 AC 93 ms
78,208 KB
testcase_27 AC 100 ms
78,976 KB
testcase_28 AC 95 ms
79,232 KB
testcase_29 AC 93 ms
77,952 KB
testcase_30 AC 85 ms
78,464 KB
testcase_31 AC 101 ms
78,592 KB
testcase_32 AC 102 ms
78,080 KB
testcase_33 AC 100 ms
79,232 KB
testcase_34 AC 103 ms
79,232 KB
testcase_35 AC 104 ms
79,360 KB
testcase_36 AC 104 ms
79,488 KB
testcase_37 AC 106 ms
79,104 KB
testcase_38 AC 113 ms
79,360 KB
testcase_39 AC 96 ms
79,232 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, Q = map(int, input().split())
S = input()
cnt = [[0] * 26 for _ in range(n + 1)]
for i, s in enumerate(S, 1):
    cnt[i] = cnt[i - 1].copy()
    cnt[i][ord(s) - 97] += 1
    
for _ in range(Q):
    l, r, x = map(int, input().split())
    tot = 0
    for i in range(26):
        tot += cnt[r][i] - cnt[l - 1][i]
        if tot >= x:
            print(chr(i + 97))
            break
0