結果

問題 No.1471 Sort Queries
ユーザー Super SolenoidSuper Solenoid
提出日時 2021-05-03 02:55:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 551 bytes
コンパイル時間 551 ms
コンパイル使用メモリ 11,012 KB
実行使用メモリ 10,000 KB
最終ジャッジ日時 2023-09-28 18:27:25
合計ジャッジ時間 10,680 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 RE -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 RE -
testcase_11 WA -
testcase_12 WA -
testcase_13 RE -
testcase_14 RE -
testcase_15 WA -
testcase_16 WA -
testcase_17 RE -
testcase_18 RE -
testcase_19 WA -
testcase_20 WA -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 TLE -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

L = []
Y = [[] for _ in range(Q)]

for i in range(Q):
    L.append(list(map(int, input().split())))

for i in list(set([p[0] for p in L])):
    a = [[j, x] for j, x in enumerate(L) if x[0] == i]
    for k in list(set([q[1][1] for q in a])):
        b = [[y[1][2], y] for y in a if y[1][1] == k]
        s = ''.join(sorted(S[(i-1):k]))
        for l in list(set([r[0] for r in b])):
            for m in b:
                if l==m[0]:
                    Y[l-1] = s[l-1]

for i in range(Q):
    print(Y[i])
0