結果

問題 No.1471 Sort Queries
ユーザー gorugo30gorugo30
提出日時 2021-05-08 17:01:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 112 ms / 2,000 ms
コード長 465 bytes
コンパイル時間 433 ms
コンパイル使用メモリ 81,748 KB
実行使用メモリ 79,312 KB
最終ジャッジ日時 2023-10-16 22:20:17
合計ジャッジ時間 6,592 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
53,484 KB
testcase_01 AC 34 ms
53,484 KB
testcase_02 AC 33 ms
53,484 KB
testcase_03 AC 39 ms
59,868 KB
testcase_04 AC 36 ms
53,484 KB
testcase_05 AC 34 ms
53,484 KB
testcase_06 AC 35 ms
53,484 KB
testcase_07 AC 39 ms
53,484 KB
testcase_08 AC 43 ms
62,124 KB
testcase_09 AC 39 ms
59,852 KB
testcase_10 AC 35 ms
53,484 KB
testcase_11 AC 36 ms
53,484 KB
testcase_12 AC 41 ms
59,868 KB
testcase_13 AC 71 ms
72,988 KB
testcase_14 AC 68 ms
70,940 KB
testcase_15 AC 77 ms
73,284 KB
testcase_16 AC 69 ms
73,592 KB
testcase_17 AC 68 ms
70,940 KB
testcase_18 AC 65 ms
70,940 KB
testcase_19 AC 69 ms
70,940 KB
testcase_20 AC 76 ms
72,988 KB
testcase_21 AC 69 ms
73,592 KB
testcase_22 AC 67 ms
70,940 KB
testcase_23 AC 95 ms
78,440 KB
testcase_24 AC 95 ms
78,440 KB
testcase_25 AC 103 ms
78,556 KB
testcase_26 AC 96 ms
77,812 KB
testcase_27 AC 99 ms
79,028 KB
testcase_28 AC 100 ms
78,980 KB
testcase_29 AC 103 ms
77,876 KB
testcase_30 AC 88 ms
78,168 KB
testcase_31 AC 104 ms
78,244 KB
testcase_32 AC 107 ms
77,748 KB
testcase_33 AC 112 ms
79,064 KB
testcase_34 AC 112 ms
79,068 KB
testcase_35 AC 109 ms
79,064 KB
testcase_36 AC 106 ms
79,064 KB
testcase_37 AC 106 ms
79,140 KB
testcase_38 AC 111 ms
79,312 KB
testcase_39 AC 95 ms
78,844 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, Q = map(int, input().split())
S = input()
C = [[0] * (26) for i in range(N + 1)]
for i in range(N):
    for j in range(26):
        if j == ord(S[i]) - ord("a"):
            C[i + 1][j] = C[i][j] + 1
        else:
            C[i + 1][j] = C[i][j]

for q in range(Q):
    L, R, X = map(int, input().split())
    L -= 1
    n = 0
    for j in range(26):
        n += C[R][j] - C[L][j]
        if n >= X:
            print(chr(ord("a") + j))
            break
    
0