Submission #72574913


Source Code Expand

import sys,bisect
from heapq import heappop, heappush
from collections import deque, Counter, defaultdict
sys.setrecursionlimit(10**7)
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
inf = 2 ** 63 - 1
mod = 998244353


N,Q = mi()
S = list(input())
id = 0
for _ in range(Q):
    t,x = mi()
    # x-=1
    if t==1:
        x-=1
        y = x+id
        S[y],S[y+1] = S[y+1],S[y]
    else:id+=x
print("".join(S[id:]))

Submission Info

Submission Time
Task E - EGFクエリ
User guild2026_288
Language Python (PyPy 3.11-v7.3.20)
Score 100
Code Size 524 Byte
Status AC
Exec Time 283 ms
Memory 167200 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 20
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 01_random_16.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 70 ms 96816 KiB
00_sample_01.txt AC 71 ms 96332 KiB
00_sample_02.txt AC 69 ms 96816 KiB
01_random_00.txt AC 194 ms 156980 KiB
01_random_01.txt AC 267 ms 167200 KiB
01_random_02.txt AC 103 ms 133492 KiB
01_random_03.txt AC 226 ms 157216 KiB
01_random_04.txt AC 256 ms 144108 KiB
01_random_05.txt AC 263 ms 160480 KiB
01_random_06.txt AC 180 ms 143952 KiB
01_random_07.txt AC 266 ms 164132 KiB
01_random_08.txt AC 240 ms 141080 KiB
01_random_09.txt AC 270 ms 162016 KiB
01_random_10.txt AC 238 ms 133228 KiB
01_random_11.txt AC 283 ms 164544 KiB
01_random_12.txt AC 250 ms 152376 KiB
01_random_13.txt AC 70 ms 96600 KiB
01_random_14.txt AC 281 ms 166808 KiB
01_random_15.txt AC 276 ms 167044 KiB
01_random_16.txt AC 279 ms 167068 KiB