結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
51,968 KB
testcase_01 AC 38 ms
51,968 KB
testcase_02 AC 39 ms
52,480 KB
testcase_03 AC 41 ms
52,992 KB
testcase_04 AC 41 ms
52,608 KB
testcase_05 AC 41 ms
52,864 KB
testcase_06 AC 40 ms
52,224 KB
testcase_07 AC 45 ms
52,352 KB
testcase_08 AC 44 ms
58,240 KB
testcase_09 AC 40 ms
52,352 KB
testcase_10 AC 39 ms
52,096 KB
testcase_11 AC 41 ms
52,608 KB
testcase_12 AC 42 ms
53,248 KB
testcase_13 AC 73 ms
71,936 KB
testcase_14 AC 71 ms
71,168 KB
testcase_15 AC 79 ms
73,984 KB
testcase_16 AC 74 ms
71,168 KB
testcase_17 AC 70 ms
70,400 KB
testcase_18 AC 67 ms
69,228 KB
testcase_19 AC 72 ms
69,632 KB
testcase_20 AC 78 ms
73,180 KB
testcase_21 AC 71 ms
72,320 KB
testcase_22 AC 71 ms
70,144 KB
testcase_23 AC 97 ms
78,852 KB
testcase_24 AC 97 ms
78,756 KB
testcase_25 AC 105 ms
78,976 KB
testcase_26 AC 100 ms
78,080 KB
testcase_27 AC 103 ms
79,348 KB
testcase_28 AC 100 ms
79,208 KB
testcase_29 AC 97 ms
78,192 KB
testcase_30 AC 89 ms
78,336 KB
testcase_31 AC 105 ms
78,428 KB
testcase_32 AC 107 ms
78,116 KB
testcase_33 AC 109 ms
79,488 KB
testcase_34 AC 110 ms
79,616 KB
testcase_35 AC 113 ms
79,616 KB
testcase_36 AC 106 ms
79,232 KB
testcase_37 AC 106 ms
79,368 KB
testcase_38 AC 114 ms
79,564 KB
testcase_39 AC 96 ms
79,464 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