結果

問題 No.1471 Sort Queries
ユーザー 330Xs330Xs
提出日時 2022-02-03 16:41:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 502 ms / 2,000 ms
コード長 533 bytes
コンパイル時間 432 ms
コンパイル使用メモリ 87,192 KB
実行使用メモリ 78,952 KB
最終ジャッジ日時 2023-09-02 03:19:39
合計ジャッジ時間 10,598 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 95 ms
71,812 KB
testcase_01 AC 98 ms
71,808 KB
testcase_02 AC 93 ms
71,800 KB
testcase_03 AC 108 ms
76,900 KB
testcase_04 AC 112 ms
78,884 KB
testcase_05 AC 94 ms
71,704 KB
testcase_06 AC 94 ms
71,804 KB
testcase_07 AC 95 ms
71,792 KB
testcase_08 AC 107 ms
76,800 KB
testcase_09 AC 97 ms
71,676 KB
testcase_10 AC 95 ms
71,792 KB
testcase_11 AC 97 ms
71,592 KB
testcase_12 AC 105 ms
77,200 KB
testcase_13 AC 151 ms
78,096 KB
testcase_14 AC 154 ms
78,292 KB
testcase_15 AC 181 ms
78,444 KB
testcase_16 AC 134 ms
78,412 KB
testcase_17 AC 145 ms
78,244 KB
testcase_18 AC 141 ms
78,340 KB
testcase_19 AC 138 ms
78,320 KB
testcase_20 AC 177 ms
78,152 KB
testcase_21 AC 150 ms
78,408 KB
testcase_22 AC 142 ms
78,028 KB
testcase_23 AC 255 ms
78,108 KB
testcase_24 AC 251 ms
78,200 KB
testcase_25 AC 307 ms
78,340 KB
testcase_26 AC 237 ms
78,328 KB
testcase_27 AC 304 ms
78,352 KB
testcase_28 AC 338 ms
78,484 KB
testcase_29 AC 248 ms
78,176 KB
testcase_30 AC 230 ms
78,292 KB
testcase_31 AC 319 ms
78,300 KB
testcase_32 AC 502 ms
78,732 KB
testcase_33 AC 343 ms
78,952 KB
testcase_34 AC 429 ms
78,416 KB
testcase_35 AC 448 ms
78,872 KB
testcase_36 AC 319 ms
78,332 KB
testcase_37 AC 321 ms
78,308 KB
testcase_38 AC 343 ms
78,252 KB
testcase_39 AC 364 ms
78,144 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
n,m = map(int,input().split())
s = list(map(str,input()))
ss = sorted(s)
d = defaultdict(list)
for i in range(n):
    d[s[i]].append(i+1)

dd = sorted(d.items())
for _ in range(m):
    a,b,c = map(int,input().split())
    cnt = 0
    flag = False
    for key,lis in dd:
        for v in lis:
            if(a <= v <= b):
                cnt += 1
            if(cnt == c):
                print(key)
                flag = True
                break
        if(flag):
            break
            
0