Submission #50361713


Source Code Expand

n,q = map(int,input().split())
s = list(input())
t = []
for i in range(n-1):
  t.append(s[i]==s[i+1])

for i in range(q):
  m,l,r = map(int,input().split())
  if m == 1:
    if l!=1:
      t[l-2]=not t[l-2]
    if r!=n:
      t[r-1]=not t[r-1]
  else:
    if True in t[l-1:r-1]:
      print("No")
    else:
      print("Yes")

Submission Info

Submission Time
Task E - Alternating String
User quilt
Language Python (CPython 3.11.4)
Score 0
Code Size 344 Byte
Status TLE
Exec Time 3312 ms
Memory 24700 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 450
Status
AC × 2
AC × 18
TLE × 24
Set Name Test Cases
Sample example_00.txt, example_01.txt
All example_00.txt, example_01.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, hand_08.txt, hand_09.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, random_21.txt, random_22.txt, random_23.txt, random_24.txt, random_25.txt, random_26.txt, random_27.txt, random_28.txt, random_29.txt
Case Name Status Exec Time Memory
example_00.txt AC 10 ms 8460 KiB
example_01.txt AC 10 ms 8424 KiB
hand_00.txt TLE 3311 ms 21136 KiB
hand_01.txt TLE 3312 ms 21168 KiB
hand_02.txt TLE 3312 ms 23612 KiB
hand_03.txt AC 760 ms 21072 KiB
hand_04.txt AC 1500 ms 8548 KiB
hand_05.txt AC 785 ms 21112 KiB
hand_06.txt TLE 3312 ms 21040 KiB
hand_07.txt AC 795 ms 21164 KiB
hand_08.txt AC 795 ms 21184 KiB
hand_09.txt AC 825 ms 22976 KiB
random_00.txt TLE 3311 ms 23012 KiB
random_01.txt TLE 3312 ms 20868 KiB
random_02.txt TLE 3312 ms 23612 KiB
random_03.txt TLE 3311 ms 24192 KiB
random_04.txt AC 75 ms 17424 KiB
random_05.txt AC 76 ms 17356 KiB
random_06.txt TLE 3311 ms 22472 KiB
random_07.txt TLE 3311 ms 23972 KiB
random_08.txt TLE 3311 ms 24700 KiB
random_09.txt TLE 3312 ms 21088 KiB
random_10.txt AC 77 ms 21088 KiB
random_11.txt AC 70 ms 17368 KiB
random_12.txt TLE 3311 ms 24040 KiB
random_13.txt TLE 3311 ms 24032 KiB
random_14.txt TLE 3311 ms 24024 KiB
random_15.txt TLE 3311 ms 24040 KiB
random_16.txt AC 70 ms 17444 KiB
random_17.txt AC 70 ms 17392 KiB
random_18.txt TLE 3311 ms 23304 KiB
random_19.txt TLE 3311 ms 24016 KiB
random_20.txt TLE 3311 ms 23984 KiB
random_21.txt TLE 3311 ms 22484 KiB
random_22.txt AC 74 ms 17396 KiB
random_23.txt AC 75 ms 18480 KiB
random_24.txt TLE 3311 ms 24220 KiB
random_25.txt TLE 3311 ms 23692 KiB
random_26.txt TLE 3311 ms 24288 KiB
random_27.txt TLE 3312 ms 22980 KiB
random_28.txt AC 71 ms 17432 KiB
random_29.txt AC 73 ms 19684 KiB