Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03434 (python)

Fixed submission:
N = int(input())
a = [110]
a = list(map(int, input().split()))
a.sort(reverse=True)
 
Alis = 0
Bob = 0
for j in range(N):
  if j % 2 == 0:
    Alis += a[j]
  else:
    Bob += a[j]
    
print(Alis-Bob)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = [110]
a = list(map(int, input().sprit()))
a.sort(reverse=True)
 
Alis = 0
Bob = 0
for j in range(N):
  if j % 2 == 0:
    Alis += a[j]
  else:
    Bob += a[j]
 
print(Alis-Bob)

Buggy submission (verdict: Runtime Error):
N = input()
a = [110]
for i in range(N):
  a[1] = input()
a.sort(reverse=True)

int Alis = 0
int Bob = 0
for j in range(N):
  if j % 2 == 0:
    Alis += a[j]
  else:
    Bob += [j]

print(Alis-Bob)
Problem p03485 (python)

Fixed submission:
a, b = (int(x) for x in input().split())
 
x = (a+b)/2
 
if (a+b) % 2 == 0:
  print(int(x))
else:
  print(int(1+(a+b)//2))

Buggy submission (verdict: Runtime Error):
a, b = input().split()

x = (a+b)/2

if x % 2 == 0:
  print(x)
else:
  print(1+(a+b)//2)
Problem p02823 (python)

Fixed submission:
n ,a,b= map(int,input().split())
cur = (b-a-1)
if cur %2==0:
    left = a-1
    right = n-b
    if b-a == 1:
        print(min(n-a,b-1))
    else:
        cur =0
        if left<right:
            cur = left
            a = 1
            b -= left
        else:
            cur = right
            a+=right
            b=n
        if b-a ==1:
            print(cur+1)
        else:
            need = b-a
            if need %2 ==0:
                need+=2
            else:
                need+=1
            print(cur+(need)//2)
else:
    cur +=1
    print(cur//2)

Buggy submission (verdict: Runtime Error):
n ,a,b= map(int,input().split())
cur = (b-a-1)
if cur %2==0:
    left = b-1
    right = n-a
    print(min(left,right))
else:
    cur +=1
    print(cur//2)
Problem p02843 (python)

Fixed submission:
money = [0,1,2,3,4,5]
n = int(input())
p = 0
lm = n//100
need = n - (lm*100)
if n>=100:
    print(1 if lm*5>= need else 0)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
money = [0,1,2,3,4,5]
n = int(input())
p = 0
lm = n//100
need = n - (lm*100)
def dfs( cur,limit):
    global p,need
    if not p:
        for i in range(6):
            now = cur+money[i]
            if limit+1 == lm:
                if now == need:
                    p =1
                    break
            elif limit+1<=lm:
                dfs(now,limit+1)
if n>=100:
    dfs(0,0)
    print(1 if p else 0)
else:
    print(0)
Problem p02971 (python)

Fixed submission:
import sys
n = int(input())
a = []
count = [0 for _ in range(200001)]
for i in range(n):
    next = int(sys.stdin.readline())
    a.append(next)
    count[next]+=1
start = 0
for i in range(200000,0,-1):
    if count[i]>0:
        v1=i
        count[i]-=1
        start = i
        break
for i in range(start,0,-1):
    if count[i]>0:
        v2=i
        count[i]-=1
        break
count[v1]+=1
count[v2]+=1
if count[v1]>1:
    for i in range(n):
        sys.stdout.write('{}\n'.format(v1))
else:
    for v in a:
        if v != v1:
            sys.stdout.write('{}\n'.format(v1))
        else:
            sys.stdout.write('{}\n'.format(v2))

Buggy submission (verdict: Runtime Error):
import sys
n = int(input())
a = []
count = [0 for _ in range(2000001)]

for i in range(n):
    next = int(sys.stdin.readline())
    a.append(next)
    count[next]+=1
start = 0
for i in range(20000,0,-1):
    if count[i]>0:
        v1=i
        count[i]-=1
        start = i
        break
for i in range(start,0,-1):
    if count[i]>0:
        v2=i
        count[i]-=1
        start = i
        break
count[v1]+=1
count[v2]+=1
if count[v1]>1:
    for i in range(n):
        sys.stdout.write('{}\n'.format(v1))
else:
    for v in a:
        if v != v1:
            sys.stdout.write('{}\n'.format(v1))
        else:
            sys.stdout.write('{}\n'.format(v2))
Problem p02995 (python)

Fixed submission:
a, b, c, d = map(int, input().split())
s = 0
start = a // c
end = b // c
if start * c < a:
    s += end - (start + 1) + 1
else:
    s += end - start + 1
if d % c != 0:
    start = a // d
    end = b // d
    if start * d < a:
        s += end - (start + 1) + 1
    else:
        s += end - start + 1
    def gcd(x, y):
        while y != 0:
            (x, y) = (y, x % y)
        return x
        return gcd
    last = c * d // gcd(c, d)
    start = a // last
    end = b // last
    if start * last < a:
        s -= end - (start + 1) + 1
    else:
        s -= end - start + 1
print((b - a + 1) - s)

Buggy submission (verdict: Runtime Error):
import math
a,b,c,d = map(int,input().split())
s=0
start = a//c
end = b//c
a * b // math.gcd(a, b)
if start*c<a:
    s += end-(start+1)+1
else:
    s += end - start + 1
if d%c!=0:
    start = a // d
    end = b // d
    if start * d < a:
        s += end - (start + 1) + 1
    else:
        s += end - start + 1
def gcd(x, y):
    while y != 0:
        (x, y) = (y, x % y)
    return x

    return gcd
last =c * d // gcd(c, d)
start = a//last
end = b//last
if start*c<a:
    s -= end-(start+1)+1
else:
    s -= end - start + 1
print((b-a+1)-s)

Buggy submission (verdict: Runtime Error):
import math
a,b,c,d = map(int,input().split())
s=0
start = a//c
end = b//c
a * b // math.gcd(a, b)
if start*c<a:
    s += end-(start+1)+1
else:
    s += end - start + 1
if d%c!=0:
    start = a // d
    end = b // d
    if start * d < a:
        s += end - (start + 1) + 1
    else:
        s += end - start + 1
last =c * d // math.gcd(c, d)
start = a//last
end = b//last
if start*c<a:
    s -= end-(start+1)+1
else:
    s -= end - start + 1
print((b-a+1)-s)
Problem p02996 (python)

Fixed submission:
n= int(input())
jobs = []
for i in range(n):
    a,b = map(int,input().split())
    jobs.append([a,b])
jobs = sorted(jobs,key=lambda x:[x[1],x[0]])
time = 0
for t,e in jobs:
    time+=t
    if time>e:
        print('No')
        exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
s= n
ans=[]
freeNode = [2]
cur=2
ans.append([1,2])
if n==2 :
    if k>0:
        print(-1)
    else:
        print(1)
        print(1, 2)
        exit()
else:
    s=0
    c=1
    if (n-2)*(n-1)//2<k:
        print(-1)
        exit()
    else:
        while(1):
            s += c
            cur+=1
            c+=1
            freeNode.append(cur)
            ans.append([1,cur])
            if s >=k:
                break
    if cur!=n:
        remove = s-k;
        if remove:
            for v in freeNode:
                ans.append([v,cur])
                remove-=1
                if remove==0:
                    break
        for i in range(cur + 1, n + 1):
            cur+=1
            for j in range(1, cur):
                ans.append([i, j])
        print(len(ans))
        for u,v in ans:
            print(u,v)
    else:
        remove = s - k;
        if remove:
            for v in freeNode:
                ans.append([v, cur])
                remove -= 1
                if remove == 0:
                    break
        print(len(ans))
        for u, v in ans:
            print(u, v)
Problem p03049 (python)

Fixed submission:
headB = 0
tailA = 0
both = 0
c = 0
for i in range(int(input())):
    t = input()
    if t[0] =='B' and t[-1]=='A':
        both+=1
    elif t[0] == 'B':
        headB+=1
    elif t[-1] == 'A':
        tailA +=1
    c+=t.count('AB')
if both>0:
    if tailA+headB>0:
        if tailA:
            c+=1
            tailA-=1
        if headB:
            c+=1
            headB-=1
        c+=min(headB,tailA)
        c+=both-1
    else:
        c+=both-1
else:
    c+=min(tailA,headB)
print(c)

Buggy submission (verdict: Runtime Error):
tailA = 0
both = 0
c = 0
for i in range(int(input())):
    t = input()
    if t[0] =='B' and t[-1]=='A':
        both+=1
    elif t[0] == 'B':
        headB+=1
    elif t[-1] == 'A':
        tailA +=1
    c+=t.count('AB')
if both>0:
    c+=both-1
    headB+=1
    tailA+=1
print(c+min(headB,tailA))
Problem p03050 (python)

Fixed submission:
limit = 0
n = int(input())
for v in range(1,n):
    if v*v >n:
        limit= v-1
        break
ans =0
for i in range(1,limit+1):
    a = n // i - 1
    if n//a == n%a:
        ans += a
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
limit = int(math.ceil(math.sqrt(n)))
ans =0
for i in range(1,limit):
    a = n // i - 1
    if i * a + i == n:
        ans += a
print(ans)
Problem p02923 (python)

Fixed submission:
n = int(input())
h = list(map(int, input().split()))

max_step = 0
current_step = 0
for i in range(n - 1):
    if h[i] >= h[i + 1]:
        current_step += 1
        if current_step > max_step:
            max_step = current_step
    else:
        current_step = 0
print(max_step)

Buggy submission (verdict: Runtime Error):
for i in range(n):
    current_step = 0
    for j in range(i + 1, n):
        if h[j - 1] >= h[j]:
            current_step += 1
            if current_step > max_step:
                max_step = current_step
        else:
            i = j
            break
print(max_step)
Problem p03469 (python)

Fixed submission:
s = input()
print('2018' + s[4:])

Buggy submission (verdict: Runtime Error):
n, y = map(int, input().split())
b = [-1, -1, -1]
count = 0
for i in range(n + 1):
  for j in range(n + 1):
    k = n - i - j
    if k < 0:
      break
    total = 10000 * i + 5000 * j + 1000 * k
    count += 1
    if total == y and (i + j + k) == n:
      b = [i, j, k]
      break
print(b)
Problem p02817 (python)

Fixed submission:
a, b = input().split()
print(b + a)

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input())
c = min(a,k)
a -= c
k -= c
b -= min(b, k)
print(a, b)
Problem p02818 (python)

Fixed submission:
a, b, k = map(int, input().split())
c = min(a,k)
a -= c
k -= c
b -= min(b, k)
print(a, b)

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input())
c = min(a,k)
a -= c
k -= c
b -= min(b, k)
print(a, b)
Problem p02817 (python)

Fixed submission:
a = input().split()
print(a[1]+a[0])

Buggy submission (verdict: Runtime Error):
in_list = input().split()
A, B, K = int(in_list[0]), int(in_list[1]), int(in_list[2])

for k in range(K):
  if A > 0:
    A -= 1
  elif B > 0:
    B -= 1
  elif:
    pass

print(A, B)
Problem p02818 (python)

Fixed submission:
import sys

def stdin_parse_int():
    a = list(map(int,input().split()))
    return a

list = stdin_parse_int()
A = list[0]
B = list[1]
K = list[2]

if A > K:
    print(str(A-K) + " " + str(B))
elif A+B > K:
    print(str(0) + " " + str(A+B-K))
else:
    print("0 0")

Buggy submission (verdict: Runtime Error):
import sys

def stdin_parse_int():
    list = []
    for i in sys.stdin.split():
        list.append(int(i))
    return list

list = stdin_parse_int()
A = list[0]
B = list[1]
K = list[2]

if A > K:
    print(str(A-K) + " " + str(B))
elif A+B > K:
    print(str(0) + " " + str(A+B-K))
else:
    print("0 0")

Buggy submission (verdict: Runtime Error):
import sys

def stdin_parse_int():
    list = []
    for i in sys.stdin:
        list.append(int(i))
    return list

list = stdin_parse_int()
A = list[0]
B = list[1]
K = list[2]

if A > K:
    print(str(A-K) + " " + str(B))
elif A+B > K:
    print(str(0) + " " + str(A+B-K))
else:
    print("0 0")

Buggy submission (verdict: Runtime Error):
import sys
a = []
for l in sys.stdin:
    a.append(int(l))

A,B,K = a[0], a[1], a[2]

if A > K:
  print(str(A-K), str(B))
elif A+B > K:
  print("0", str(A+B-K))
else:
  print("0 0")

Buggy submission (verdict: Runtime Error):
import sys
a = []
for l in sys.stdin:
    a.append(int(l))

A,B,K = a[0], a[1], a[2]

if A > K:
  print(A-K, B)
elif A+B > K:
  print(0, A+B-K)
else:
  print("0 0")

Buggy submission (verdict: Runtime Error):
in_list = input().split()
A, B, K = int(in_list[0]), int(in_list[1]), int(in_list[2])

for k in range(K):
  if A > 0:
    A -= 1
  elif B > 0:
    B -= 1
  elif:
    pass

print(A, B)

Buggy submission (verdict: Runtime Error):
in_list = input().split()
A, B, K = int(in_list[0]), int(in_list[1]), int(in_list[2])

for k in range(K):
  if A > 0:
    A -= 1
  elif B > 0:
    B -= 1
  elif:
	pass

print(A, B)

Buggy submission (verdict: Runtime Error):
in_list = (int)input().split()
A, B, K = in_list[0], in_list[1], in_list[2]

for k in range(K):
  if A > 0:
    A -= 1
  elif B > 0:
    B -= 1
  elif:
	pass

print(A, B)
Problem p02817 (python)

Fixed submission:
first, second = input().split()
print(second+first)

Buggy submission (verdict: Runtime Error):
first, second = [input().split()]
print(second+first)
Problem p02818 (python)

Fixed submission:
takahashi, aoki, kaisu = [int(x) for x in input().split()]
taka_amari = takahashi - kaisu
ao_amari = aoki
if taka_amari<0:
    ao_amari = aoki+taka_amari
 
if taka_amari<0:
    taka_amari = 0
if ao_amari<0:
    ao_amari = 0
print(str(taka_amari) + " " + str(ao_amari))

Buggy submission (verdict: Runtime Error):
takahashi, aoki, kaisu = [int(x) for x in input().split()]
taka_amari = takahashi - kaisu
if taka_amari<0:
    ao_amari = aoki+taka_amari

if taka_amari<0:
    taka_amari = 0
if ao_amari<0:
    ao_amari = 0
print(str(taka_amari) + " " + str(ao_amari))
Problem p03493 (python)

Fixed submission:
num = input()
print(num.count('1'))

Buggy submission (verdict: Runtime Error):
num = input()
evens = [int(x) for x  in input().split()]

itr = 0
flg = True
while flg:
  evens = list(map(lambda x: (x/2), evens))
  is_evens = list(map(lambda x: x.is_integer(), evens))
  if not all(is_evens):
    flg = False
    break
  itr+=1
  print(evens)
print(itr)
Problem p02910 (python)

Fixed submission:
s = input()

flag = True
for i in range(len(s)):
  if i % 2 == 0:
    if s[i] not in ['R', 'U', 'D']:
      flag = False
      break
  else:
    if s[i] not in ['L', 'U', 'D']:
      flag = False
      break
  
result = 'Yes' if flag else 'No'
print(result)

Buggy submission (verdict: Runtime Error):
s = input()

flag = True
for i in range(len(s)):
  if i % 2 == 0:
    if s[i] not in ['R', 'U', 'D']:
      flag = False
      break
  else:
    if s[i] not in ['L', 'U', 'D']:
      flag = False
      break
  
result = 'Yes' if flag else 'No'
print(result)
v
Problem p03068 (python)

Fixed submission:
n = int(input())
s = input()
k = int(input()) - 1

s = list(map(lambda x: '*' if x != s[k] else x, s))

print(*s, sep='')

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
k = int(input())

s = list(map(lambda x: '*' if x != s[k] else x, s))

print(*s, sep='')
Problem p03292 (python)

Fixed submission:
a = list(map(int, input().split()))
print(max(a) - min(a))

Buggy submission (verdict: Runtime Error):
a = map(int, input().split())
print(max(a) - min(a))
Problem p03760 (python)

Fixed submission:
o = list(input())
e = list(input()) + ['']

n = len(o)
for x, y in zip(o, e):
  print(x + y, end='')

Buggy submission (verdict: Runtime Error):
o = input()
e = input()

n = len(o)
for i in range(n):
  print(o[i] + e[i], end='')
Problem p02923 (python)

Fixed submission:
x=int(input())
l=[]
s=x
for x in map(int,input().split()):
    l.append(x)
if(s==1):
    print(0)
    exit()    
z=0
suml=0
h=[]
while(z<s-1):
    if(l[z]>=l[z+1]):
        suml+=1
    elif(l[z]>=l[z+1]):
        suml+=1
    else:
        h.append(suml)
        suml=0    
    z+=1
    if(z==s-1):
        h.append(suml)
print(max(h))

Buggy submission (verdict: Runtime Error):
x=int(input())
l=[]
s=x
for x in map(int,input().split()):
    l.append(x)
z=0
suml=0
h=[]
while(z<s-1):
    if(l[z]>=l[z+1]):
        suml+=1
    elif(l[z]>=l[z+1]):
        suml+=1
    else:
        h.append(suml)
        suml=0    
    z+=1
    if(z==s-1):
        h.append(suml)
print(max(h))

Buggy submission (verdict: Runtime Error):
x=int(input())
l=[]
for x in map(int,input().split()):
    l.append(x)
z=len(l)-1
suml=0
h=[]
while(z>0):
    if(z==len(l)-1):
        h.append(0)
        if(l[z]<=l[z-1]):
            suml+=1
    elif(l[z]<=l[z-1]):
        suml+=1
    else:
        h.append(suml)
        suml=0
    z-=1
print(max(h))
Problem p02830 (python)

Fixed submission:
n=input()
s, t=str(input()).split()
for i in range(int(n)):
  print(list(s)[i], list(t)[i], sep='', end='')

Buggy submission (verdict: Runtime Error):
n=input()
s, t=str(input()).split()
for i in range(n):
  print(list(s)[i], list(t)[i], sep='', end='')

Buggy submission (verdict: Runtime Error):
n=input()
s=input()
t=input()
for i in range(n):
  print(list(s)[i], list(t)[i], sep='', end='')
Problem p02969 (python)

Fixed submission:
r = int(input())

menseki = 3 * r * r
print(menseki)

Buggy submission (verdict: Runtime Error):
r = input()

menseki = 3 * r * r
print(menseki)
Problem p03037 (python)

Fixed submission:
N,M = map(int,input().split())
L = []
R = []
for i in range(M):
    l,r = map(int,input().split())
    L.append(l)
    R.append(r)

L_max = max(L)
R_min = min(R)

result = R_min - L_max + 1

if result < 0:
    print(0)
else:
    print(result)

Buggy submission (verdict: Runtime Error):
import heapq
N,M = map(int, input().split())
A = list(map(int, input().split()))
BC = []

for i in range(M):
    BC.append(list(map(int, input().split())))

BC.sort(key=lambda x: x[1], reverse=True)
A_min = min(A)
heapq.heapify(A)
for i in range(M):
    for j in range(BC[i][0]):
        if BC[i][1] > min(A):
            heapq.heappush(A,BC[i][1])
            heapq.heappop(A)

    A_min = min(A)

print(sum(A))
Problem p03480 (python)

Fixed submission:
s = input()
n = len(s)

ans = n
for i in range(n-1) :
    if s[i] != s[i+1] :
        ans = min(ans, max(i+1, n-i-1))

print(ans)

Buggy submission (verdict: Runtime Error):
s = input()

def func(k):
    cnt = 0
    buf = 0
    arr = [0 for _ in s]
    arr.append(0)
    for i in range(len(s)) :
        if arr[i] == 1 :
            cnt -= 1
            buf += 1
        if (i+1 is not len(s)) and s[i] == s[i+1] :
            continue
        val = (int(s[i]) + cnt + buf)%2
        if val == 0:
            if i+k > len(s) :
                if buf > 0 :
                    buf -= 1
                    continue
                else :
                    return False
            cnt += 1
            arr[i+k] += 1
    return True

l, r = 1, len(s)+1
while r-l > 1:
    mid = (r+l)//2
    # print(mid, func(mid))
    if func(mid) : l = mid
    else : r = mid

print(l)
Problem p02812 (python)

Fixed submission:
a = int(input())
b = input()
print(b.count('ABC'))

Buggy submission (verdict: Runtime Error):
a = int(input())
b = input()
print(a.count('ABC'))
Problem p02813 (python)

Fixed submission:
from itertools import permutations
 
N = int(input())
Nlist = [i for i in range(1, N+1)] 
Nlist = list(permutations(Nlist)) 
 
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))
 
print(abs(Nlist.index(P) - Nlist.index(Q)))

Buggy submission (verdict: Runtime Error):
from itertools import permutations

N = int(input())
Nlist = [i for i in range(1, int(input())+1)] 
Nlist = list(permutations(Nlist)) 

P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))

print(abs(X.index(P)-X.index(Q)))
Problem p02817 (python)

Fixed submission:
a,b = input().split()
print(b+a)

Buggy submission (verdict: Runtime Error):
a,b,c = map(int, input().split())
if a >= c:
  a -= c
  print(a,b)
elif c-a < b:
  b -= (c-a)
  a = 0
  print(a,b)
else:
  print(0,0)

Buggy submission (verdict: Runtime Error):
a,b,c = map(int, input().split())
if a >= c:
  a -= c
  print(a,b)
elif a < c:
  b -= (c-a)
  a = 0
  print(a,b)
else:
  print(0,0)

Buggy submission (verdict: Runtime Error):
a= input()
b= input()
print(b+a)
Problem p03567 (python)

Fixed submission:
a = input()
if 'AC' in a:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a = input()
if 'AC' in s:
  print('Yes')
else:
  print('No')
Problem p03591 (python)

Fixed submission:
a = input()
if a.startswith('YAKI'):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a = input()
print(a.startswith('YAKI')startswith)
Problem p03970 (python)

Fixed submission:
a = 'CODEFESTIVAL2016'
b = input()
lista = list(a)
listb = list(b)
count = 0
for i in range(len(lista)):
  if lista[i]!=listb[i]:
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
a = 'CODEFESTIVAL2016'
b = input()
lista = list(a)
listb = list(b)
count = 0
for i in range(len(lista)):
  if lista[i]!=listb[i]:
    count++
print(count)

Buggy submission (verdict: Runtime Error):
a = 'CODEFESTIVAL2016'
b = input()
lista = list(a)
listb = list(b)
count = 0
for i in range(len(lista)):
  if lista[i]!=listb[i]:
    count++
print(count)
Problem p03992 (python)

Fixed submission:
a = input()
a_first, a_last = a[:4], a[4:]
print(a_first + ' ' + a_last)

Buggy submission (verdict: Runtime Error):
a = input()
a_first, a_last = s[:4], s[4:]
print(a_first + ' ' + a_last)
Problem p02848 (python)

Fixed submission:
n = int(input())
s = input()
b = ""
ab = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

for i in range(int(len(s))):
    for j in range(int(len(ab))):
        if (s[i] == ab[j]):
            if (int(j+n) > 25):
                b += ab[j+n-26]
                break
            else:
                b += ab[j+n]
                break

print(b)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
b = ""
ab = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

for i in range(int(len(s))):
    for j in range(int(len(ab))):
        if (s[i] == ab[j]):
            if (int(j+n) > 25):
                b += ab[j+n-25]
                break
            else:
                b += ab[j+n]
                break

print(b)
Problem p02910 (python)

Fixed submission:
"""
abc141-b
"""

S = input()

ans="Yes"

for i in range(int(len(S))):
    if (i % 2 == 0):
        if (S[i] == "L"):
            ans="No"
            break
    else:
        if (S[i] == "R"):
            ans="No"
            break
print(ans)

Buggy submission (verdict: Runtime Error):
"""
abc141-b
"""

S = input()

ans="Yes"

for i in range(int(len(S))):
    if (i % 2 == 0):
        if (S[i] == "L"):
            ans="No"
            break
    else:
        if (S[i] == "R"):
            ans="No"
            break
print(ans
Problem p03000 (python)

Fixed submission:
n, x = list(map(int, input().split()))
l = input()
ans = 1
cnt = 0

l_list = l.split(' ')

for i in l_list:
    cnt += int(i)
    if cnt > x:
        break
    ans += 1

print (ans)

Buggy submission (verdict: Runtime Error):
n, x = list(map(int, input().split()))
l = input()
ans = 1
cnt = 0

l_list = l.split(' ')

for i in l_list:
    cnt += i
    if cnt > x:
        break
    ans += 1

print (ans)
Problem p03005 (python)

Fixed submission:
n, k = list(map(int, input().split()))

if k == 1:
    print(0)
else:
    print(n-k)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = []
l2 = []

for i in range(n):
    a, b = list(map(int, input().split()))
    l.append([a,b])
l.sort()

for i in range(len(l)-1):
    for j in range(i+1, len(l)):
        dif1 = l[i][0] - l[j][0]
        dif2 = l[i][1] - l[j][1]
        l2.append(str(dif1) + ' ' + str(dif2))
##print(l2)

try:
    cnt = max(l2, key=l2.count)
except:
    cnt = "1000000 1000000"
x, y = list(map(int, cnt.split()))

ans = 0

for i in range(len(l)):
    if [l[i][0] + x, l[i][1] + y] in l:
        ans += 1

print(n - ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = []
l2 = []

for i in range(n):
    a, b = list(map(int, input().split()))
    l.append([a,b])

for i in range(n-1):
    for j in range(i+1, n):
        dif1 = l[i][0] - l[j][0]
        dif2 = l[i][1] - l[j][1]
        l2.append(str(dif1) + ' ' + str(dif2))
##print(l2)

try:
    cnt = max(l2, key=l2.count)
except:
    cnt = 0
x, y = list(map(int, cnt.split()))

ans = 0

for i in range(len(l)):
    if [l[i][0] + x, l[i][1] + y] in l:
        ans += 1

print(n - ans)