結果

問題 No.1471 Sort Queries
ユーザー ygd.ygd.
提出日時 2021-04-09 23:37:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 148 ms / 2,000 ms
コード長 546 bytes
コンパイル時間 437 ms
コンパイル使用メモリ 87,216 KB
実行使用メモリ 80,760 KB
最終ジャッジ日時 2023-09-07 18:34:19
合計ジャッジ時間 6,440 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,404 KB
testcase_01 AC 74 ms
71,420 KB
testcase_02 AC 77 ms
71,388 KB
testcase_03 AC 79 ms
76,020 KB
testcase_04 AC 75 ms
71,180 KB
testcase_05 AC 73 ms
71,432 KB
testcase_06 AC 71 ms
71,424 KB
testcase_07 AC 72 ms
71,544 KB
testcase_08 AC 79 ms
76,296 KB
testcase_09 AC 78 ms
76,032 KB
testcase_10 AC 71 ms
71,236 KB
testcase_11 AC 74 ms
71,424 KB
testcase_12 AC 79 ms
76,828 KB
testcase_13 AC 110 ms
79,344 KB
testcase_14 AC 108 ms
79,088 KB
testcase_15 AC 117 ms
79,248 KB
testcase_16 AC 107 ms
77,476 KB
testcase_17 AC 109 ms
79,216 KB
testcase_18 AC 106 ms
79,264 KB
testcase_19 AC 108 ms
77,060 KB
testcase_20 AC 118 ms
79,256 KB
testcase_21 AC 114 ms
79,356 KB
testcase_22 AC 107 ms
79,096 KB
testcase_23 AC 132 ms
79,212 KB
testcase_24 AC 131 ms
79,212 KB
testcase_25 AC 139 ms
79,244 KB
testcase_26 AC 130 ms
78,932 KB
testcase_27 AC 135 ms
79,276 KB
testcase_28 AC 134 ms
79,220 KB
testcase_29 AC 129 ms
79,140 KB
testcase_30 AC 122 ms
79,012 KB
testcase_31 AC 139 ms
79,164 KB
testcase_32 AC 141 ms
79,264 KB
testcase_33 AC 145 ms
80,736 KB
testcase_34 AC 148 ms
80,516 KB
testcase_35 AC 146 ms
80,760 KB
testcase_36 AC 143 ms
80,720 KB
testcase_37 AC 141 ms
80,616 KB
testcase_38 AC 142 ms
80,100 KB
testcase_39 AC 135 ms
79,020 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,Q = map(int,input().split())
S = str(input())
SA = []
for i in range(26):
    s_temp = [0]
    moji = chr(i+97)
    for j in range(N):
        if S[j] == moji:
            temp = s_temp[-1] + 1
        else:
            temp = s_temp[-1]
        s_temp.append(temp)
    SA.append(s_temp)
#print(SA)

for i in range(Q):
    l,r,x = map(int,input().split())
    l-=1;r-=1
    cnt = 0
    for j in range(26):
        temp = SA[j][r+1] - SA[j][l]
        cnt += temp
        if cnt >= x:
            ans = chr(j+97)
            break
    print(ans)
0