結果

問題 No.1471 Sort Queries
ユーザー Super SolenoidSuper Solenoid
提出日時 2021-05-03 05:08:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,687 ms / 2,000 ms
コード長 616 bytes
コンパイル時間 616 ms
コンパイル使用メモリ 10,744 KB
実行使用メモリ 31,904 KB
最終ジャッジ日時 2023-09-28 20:36:09
合計ジャッジ時間 26,036 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
7,808 KB
testcase_01 AC 17 ms
7,808 KB
testcase_02 AC 18 ms
7,852 KB
testcase_03 AC 19 ms
8,328 KB
testcase_04 AC 18 ms
8,312 KB
testcase_05 AC 18 ms
7,764 KB
testcase_06 AC 17 ms
7,912 KB
testcase_07 AC 18 ms
7,832 KB
testcase_08 AC 19 ms
8,304 KB
testcase_09 AC 18 ms
8,196 KB
testcase_10 AC 17 ms
7,804 KB
testcase_11 AC 18 ms
7,972 KB
testcase_12 AC 20 ms
8,180 KB
testcase_13 AC 414 ms
19,044 KB
testcase_14 AC 326 ms
17,560 KB
testcase_15 AC 376 ms
17,928 KB
testcase_16 AC 81 ms
10,640 KB
testcase_17 AC 358 ms
17,956 KB
testcase_18 AC 302 ms
17,140 KB
testcase_19 AC 100 ms
11,800 KB
testcase_20 AC 398 ms
18,240 KB
testcase_21 AC 313 ms
17,184 KB
testcase_22 AC 306 ms
17,116 KB
testcase_23 AC 1,050 ms
26,468 KB
testcase_24 AC 1,056 ms
26,480 KB
testcase_25 AC 1,190 ms
27,628 KB
testcase_26 AC 611 ms
21,412 KB
testcase_27 AC 1,586 ms
31,560 KB
testcase_28 AC 1,534 ms
31,068 KB
testcase_29 AC 645 ms
21,772 KB
testcase_30 AC 998 ms
26,216 KB
testcase_31 AC 957 ms
24,988 KB
testcase_32 AC 624 ms
21,028 KB
testcase_33 AC 1,687 ms
31,684 KB
testcase_34 AC 1,672 ms
31,752 KB
testcase_35 AC 1,670 ms
31,760 KB
testcase_36 AC 1,662 ms
31,800 KB
testcase_37 AC 1,654 ms
31,824 KB
testcase_38 AC 806 ms
31,708 KB
testcase_39 AC 867 ms
31,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, Q = map(int, input().split())
S = input()

alpha =['a','b','c','d','e','f','g','h','i','j','k','l','m','n',
        'o','p','q','r','s','t','u','v','w','x','y','z']

data = [[[0] for k in range(26)] for _ in range(N)]

for i in range(N):
    for k in range(26):
        data[i][k] = S.count(alpha[k], 0, i+1)

a = [0]*26

for i in range(Q):
    l, r, x = list(map(int, input().split()))
    if l > 1:
        DATA = data[l-2]
    else:
        DATA = a

    d = data[r-1][0] - DATA[0]
    for j in range(26):
        if d >= x:
            print(alpha[j])
            break
        d += data[r-1][j+1] - DATA[j+1]
0