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

Fixed submission:
r,g,b = map(int, input().split())
x = 100*r +10*g + b
if x % 4 == 0:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
r,g,b = map(int, input().split)
x = 100*r +10*g +b
if x % 4 == 0:
    print('YES')
else:
    print('NO')
Problem p04030 (python)

Fixed submission:
s = input()

ans = []

for i in s:
    if i == "0":
        ans.append("0")
    elif i == "1":
        ans.append("1")
    elif i == "B" and len(ans) == 0:
        ans
    else:
        ans.pop()
print("".join(ans))

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

ans = []

for i in s:
    if i == "0":
        ans.append("0")
    elif i == "1":
        ans.append("1")
    else:
        ans.pop()
print("".join(ans))
Problem p02639 (python)

Fixed submission:
print(list(input().split()).index("0")+1)

Buggy submission (verdict: Runtime Error):
n = map(int, input().split())
for i in range(5):
  if n[i] == 0:
    print(i+1)
	exit()
Problem p02658 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
s = 1
if 0 in a:
    print(0)
    exit()
for i in range(n):
  s *= a[i]
  if s>10**18:
      print(-1)
      exit()
print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = sorted(list(map(int, input().split())))
s = 1
if o in a:
    print(0)
    exit()
for i in range(n):
  s *= a[i]
  if s>10**18:
      print(-1)
      exit()
print(s)
Problem p02658 (python)

Fixed submission:
import sys

n = int(input())
a = list(map(int,input().split()))

if 0 in a :
  print(0)
  sys.exit()

ans = 1
for i in range(n) :
  ans *= a[i]
  if ans > 10**18 :
    ans = -1
    break
    
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))

ans = 1
for n in range(n) :
  ans *= a[i]
  if ans > 10**18 :
    ans = -1
    break
    
print(ans)
Problem p02678 (python)

Fixed submission:
from collections import deque

def bfs(graph, visited, ss):
  queue = deque([ss])
  visited[ss] = 0
  ans = [0]*n
  while queue:
    s = queue.popleft()
    for new_s in graph[s] :
      if visited[new_s] == -1:
        #　移動回数の計算
        visited[new_s] = visited[s] + 1
        queue.append(new_s)
        ans[new_s] = s
  return ans

n,m = map(int,input().split())
graph = [[] for j in range(n)]

for i in range(m):
    a,b = map(int, input().split())
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)

visited = [-1]*n
ans = bfs(graph, visited, 0)

print('Yes')
for i in range(1,n) :
  print(ans[i]+1)

Buggy submission (verdict: Runtime Error):
from collections import deque

def bfs(graph, visited, ss, g):
  queue = deque([ss])
  visited[ss] = 0
  while queue:
    s = queue.popleft()
    #　返り値に関する条件
    if visited[g] != -1 :
        return visited
    for new_s in graph[s] :
      if graph[new_s][s] == 1 and visited[new_s] == -1:
        #　移動回数の計算
        visited[new_s] = visited[s] + 1
        queue.append(new_s)
  return visited

n,m = map(int,input().split())
graph = [[] for j in range(n)]

for i in range(m):
    a,b = map(int, input().split())
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)
 
d = [0]*n
for g in range(1,n) :
    visited = [-1]*n
    d[g] = bfs(graph, visited, 0, g)[g]
Problem p02761 (python)

Fixed submission:
import sys

n,m = map(int,input().split())
s = [] ; c = []
for i in range(m) :
  st,ct = map(int,input().split())
  s.append(st) ; c.append(ct)

ans = [[0,0] for i in range(n)]  
for i in range(m) :
  if s[i] == 1 and c[i] == 0 and n >= 2 :
    print(-1)
    sys.exit()
  if ans[s[i]-1][1] == 0 :
    ans[s[i]-1][0] = c[i] 
    ans[s[i]-1][1] = 1
  else :
    if ans[s[i]-1][0] != c[i] :
      print(-1)
      sys.exit()

if ans[0][0] == 0 and n >= 2 :
  ans[0][0] = 1

ansn = 0
for i in range(n) :
  ansn += ans[i][0]*10**(n-1-i)
  
print(ansn)

Buggy submission (verdict: Runtime Error):
import sys

n,m = map(int,input().split())
s = [] ; c = []
for i in range(m) :
  st,ct = map(int,input().split())
  s.append(st) ; c.append(ct)

if n == 1 :
  ans(c[0])
  sys.exit()

ans = [[0,0] for i in range(n)]  
for i in range(m) :
  if s[i] == 1 and c[i] == 0 :
    print(-1)
    sys.exit()
  if ans[s[i]-1][1] == 0 :
    ans[s[i]-1][0] = c[i] 
    ans[s[i]-1][1] = 1
  else :
    if ans[s[i]-1][0] != c[i] :
      print(-1)
      sys.exit()

if ans[0][0] == 0 :
  ans[0][0] = 1

ansn = 0
for i in range(n) :
  ansn += ans[i][0]*10**(n-1-i)
  
print(ansn)
Problem p02802 (python)

Fixed submission:
n,m = map(int,input().split())
p = []
s = []

for i in range(m):
  p1,s1 = map(str,input().split())
  p.append(int(p1))
  s.append(s1)

#0が正答したかどうか（正答が1）、1がペナルティの数
ans = [[0,0] for i in range(n)]

for i in range(m) :
  if s[i] == 'AC' :
    ans[p[i]-1][0] = 1
  if s[i] == 'WA' and ans[p[i]-1][0] == 0 :
    ans[p[i]-1][1] += 1

ac = 0
pe = 0
for i in range(n) :
  ac += ans[i][0]
  if ans[i][0] == 1 :
    pe += ans[i][1]

print(ac,pe)

Buggy submission (verdict: Runtime Error):
from collections import deque

def bfs(maze, visited, sy, sx, gy, gx):
  queue = deque([[sy, sx]])
  visited[sy][sx] = 0
  while queue:
    y,x = queue.popleft()
    if [y, x] == [gy, gx]:
      return visited[y][x]
    for j, k in ([1, 0], [-1, 0], [0, 1], [0, -1]):
      new_y, new_x = y+j, x+k
      if maze[new_y][new_x] == "." and visited[new_y][new_x] == -1:
        visited[new_y][new_x] = visited[y][x] + 1
        queue.append([new_y, new_x])

h,w = map(int,input().split())
wall = ''
for i in range(w+2):
  wall += '#'
maze = [wall]
for i in range(h) :
  m1 = input()
  maze.append('#'+m1+'#')
maze .append(wall)

s = [[1,1],[1,h],[w,1],[w,h]]
g = [[w,h],[w,1],[1,h],[1,1]]

ans = []
for i in range(4) :
  sy = s[i][1] ; sx = s[i][0]
  for j in range(1,h+1) :
    for k in range(1,w+1) :
      gy = j ; gx = k
      if maze[gy][gx] == '#' :
        break
      visited = [[-1]*(w+2) for _ in range(h+2)]
      ans.append(bfs(maze, visited, sy, sx, gy, gx))

print(max(ans))
Problem p02882 (python)

Fixed submission:
import math

a,b,x = map(int,input().split())

if a*a*b == x :
  print(0)
elif a*b/2 >= x/a :
  ax = 2*x/a/b
  print(math.degrees(math.atan(b/ax)))
else : 
  bx = 2*x/a/a - b
  print(90-math.degrees(math.atan(a/(b-bx))))

Buggy submission (verdict: Runtime Error):
import math

a,b,x = map(int,input().split())

if a*b/2 >= x/a :
  ax = 2*x/a/b
  print(math.degrees(math.atan(b/ax)))
else : 
  bx = 2*x/a/a - b
  print(90-math.degrees(math.atan(a/(b-bx))))
Problem p03006 (python)

Fixed submission:
import sys

n = int(input())
x = [0]*n ; y = [0]*n
for i in range(n):
    x[i],y[i] = map(int, input().split())

if n == 1:
    print(1)
    sys.exit()

ans = []
for i in range(n):
    for j in range(n):
        if i == j:
            continue
        p = x[i]-x[j]
        q = y[i]-y[j]
        count = 0
        for k in range(n):
            for l in range(n):
                if p == x[k]-x[l] and q == y[k]-y[l]:
                    count += 1
                ans.append(count)

print(n-max(ans))

Buggy submission (verdict: Runtime Error):
from collections import Counter

n = int(input())
x = [0]*n ; y = [0]*n
for i in range(n):
    x[i],y[i] = map(int, input().split())

dc_c = []
dc_c = []
dc_ans = []
for i in range(n-1):
    ii = 0
    d = [[-1]*2 for i in range(n-1)]
    for j in range(i,n):
        if i != j:
            d[ii][0] = abs(x[i]-x[j])
            d[ii][1] = abs(y[i]-y[j])
            ii += 1
    dc = Counter(map(tuple, d))
    dc_ans = Counter(dc_ans) + dc
dc_ans = dc_ans.most_common()
if dc_ans[0][0] == (-1, -1):
    print(n-dc_ans[1][1])
else:
    print(n-dc_ans[0][1])
Problem p03244 (python)

Fixed submission:
import sys

n = int(input())
v = list(map(int,input().split()))

a1 = {}
a2 = {}
for i in range(n) :
  a = v[i]
  if i%2 == 0 :
    if a in a1 :
      a1[a] += 1
    else :
      a1[a] = 1
  else :
    if a in a2 :
      a2[a] += 1
    else :
      a2[a] = 1

a1_s = sorted(a1.items(), key = lambda x : x[1], reverse = True)
a2_s = sorted(a2.items(), key = lambda x : x[1], reverse = True)

ans = n
for i in range(min(2,len(a1_s))) :
  for j in range(min(2,len(a2_s))) :
    if a1_s[i][0] == a2_s[j][0] :
      continue
    ans = min(ans,n-a1_s[i][1]-a2_s[j][1])

if len(a1_s) == 1 and len(a2_s) == 1 and ans == n :
  ans = n//2

print(ans)

Buggy submission (verdict: Runtime Error):
import sys

n = int(input())
v = list(map(int,input().split()))

a1 = {}
a2 = {}
for i in range(n) :
  a = v[i]
  if i%2 == 0 :
    if a in a1 :
      a1[a] += 1
    else :
      a1[a] = 1
  else :
    if a in a2 :
      a2[a] += 1
    else :
      a2[a] = 1

a1_s = sorted(a1.items(), key = lambda x : x[1], reverse = True)
a2_s = sorted(a2.items(), key = lambda x : x[1], reverse = True)

ans = n
for i in range(2) :
  for j in range(2) :
    if a1_s[i][0] == a2_s[j][0] :
      continue
    ans = min(ans,n-a1_s[i][1]-a2_s[j][1])
    
print(ans)
Problem p03262 (python)

Fixed submission:
import fractions
import sys

n,x = map(int,input().split())
a = list(map(int,input().split()))

if n == 1 :
  print(abs(a[0]-x))
  sys.exit()

ans = fractions.gcd(abs(a[0]-x),abs(a[1]-x))
for i in range(2,n) :
  ans = fractions.gcd(ans,abs(a[i]-x))
  
print(ans)

Buggy submission (verdict: Runtime Error):
import fractions

n,x = map(int,input().split())
a = list(map(int,input().split()))

ans = fractions.gcd(abs(a[0]-x),abs(a[1]-x))
for i in range(2,n) :
  ans = fractions.gcd(ans,abs(a[i]-x))
  
print(ans)
Problem p03274 (python)

Fixed submission:
import bisect
import sys

n,k = map(int,input().split())
x = list(map(int,input().split()))

index = bisect.bisect_left(x,0)

if x[0] >= 0 :
  print(x[k-1])
  sys.exit()
  
if x[-1] <= 0 :
  print(x[n-k]*(-1))
  sys.exit()

ans = 10**9
if min(index+k,n) == index+k :
  ans = x[index+k-1]

if max(0,index-k) == index - k :
  ans = min(ans,x[index-k]*(-1))
  
c = 0
for i in range(index,min(index+k,n)) :
  c += 1
  if i <= n-1 and i-(k-1) <= n-1 and i-(k-1) >= 0 :
    ans = min(ans,x[i]*2+x[i-(k-1)]*(-1))

c = 0
for i in range(max(0,index-k),index) :
  c += 1
  if i <= n-1 and i+(k-1) <= n-1 :
    ans = min(ans,x[i]*(-1)*2+x[i+(k-1)])
  
print(ans)

Buggy submission (verdict: Runtime Error):
import bisect
import sys

n,k = map(int,input().split())
x = list(map(int,input().split()))

index = bisect.bisect_left(x,0)

if x[0] >= 0 :
  print(x[k-1])
  sys.exit()
  
if x[-1] <= 0 :
  print(x[n-k]*(-1))
  sys.exit()

ans = 10**9
if min(index+k,n) == index+k :
  ans = x[index+k-1]

if max(0,index-k) == index - k :
  ans = min(ans,x[index-k]*(-1))
  
c = 0
for i in range(index,min(index+k,n)) :
  c += 1
  ans = min(ans,x[i]*2+x[i-(k-1)]*(-1))

c = 0
for i in range(max(0,index-k),index) :
  c += 1
  ans = min(ans,x[i]*(-1)*2+x[i+(k-1)])
  
print(ans)
Problem p03409 (python)

Fixed submission:
n = int(input())

r = [[0,0,1] for i in range(n)]
for i in range(n) :
  x,y = map(int,input().split())
  r[i][0],r[i][1] = x,y
  
b = [[0,0,1] for i in range(n)]
for i in range(n) :
  x,y = map(int,input().split())
  b[i][0],b[i][1] = x,y
  
r.sort(key=lambda x: x[0],reverse=True)
b.sort(key=lambda x: x[1])

ans = 0
for i in range(n) :
  for j in range(n) :
    if r[i][2] == 0 or b[j][2] == 0 :
      continue
    if r[i][0] < b[j][0] and r[i][1] < b[j][1] :
      r[i][2] = 0 ; b[j][2] = 0
      ans += 1
      
print(ans)

Buggy submission (verdict: Runtime Error):
# XとYの二部グラフの最大マッチング X={0,1,2,...|X|-1} Y={0,1,2,...,|Y|-1}
#   edges[x]: xとつながるYの頂点のset
#   matched[y]: yとマッチングされたXの頂点(暫定)
 
def dfs(v, visited):
    """
    :param v: X側の未マッチングの頂点の1つ
    :param visited: 空のsetを渡す（外部からの呼び出し時）
    :return: 増大路が見つかればTrue
    """
    for u in edges[v]:
        if u in visited:
            continue
        visited.add(u)
        if matched[u] == -1 or dfs(matched[u], visited):
            matched[u] = v
            return True
    return False
 
 
# 標準入力からのグラフ読み取り
n = int(input())

r = [[0,0] for i in range(n)]
for i in range(n) :
  x,y = map(int,input().split())
  r[i][0],r[i][1] = x,y
  
b = [[0,0] for i in range(n)]
for i in range(n) :
  x,y = map(int,input().split())
  b[i][0],b[i][1] = x,y

edges = [set() for _ in range(n)]
matched = [-1] * n
  
for i in range(n) :
  for j in range(n) :
    if r[i][0] < b[j][0] and r[i][1] < b[j][1] :
      edges[i].add(j)
      
# 増大路発見に成功したらTrue(=1)。合計することでマッチング数となる
print(sum(dfs(s, set()) for s in range(xn)))
Problem p03565 (python)

Fixed submission:
import sys

s = input()
t = input()

tl = len(t) ; sl = len(s)

c = 1
for i in range(sl,tl-1,-1) :
  st = s[i-tl:i]
  c = 0
  for j in range(tl) :
    if st[j] == '?' :
      continue
    elif st[j] != '?' and st[j] == t[j] :
      continue
    c = 1
    break
  if c == 0 :
    s = s[:i-tl] + t + s[i:]
    break

if c == 1 :
  print('UNRESTORABLE')
else : 
  print(s.replace('?', 'a'))

Buggy submission (verdict: Runtime Error):
import sys

s = input()
t = input()

tl = len(t) ; sl = len(s)

for i in range(sl,tl-1,-1) :
  st = s[i-tl:i]
  c = 0
  for j in range(tl) :
    if st[j] == '?' :
      continue
    elif st[j] != '?' and st[j] == t[j] :
      continue
    c = 1
    break
  if c == 0 :
    s = s[:i-tl] + t + s[i:]
    break

if c == 1 :
  print('UNRESTORABLE')
else : 
  print(s.replace('?', 'a'))

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

tl = len(t)
sl = len(s)
for i in range(sl,tl,-1) :
  st = s[i-tl:i]
  c = 0
  for j in range(tl) :
    if st[j] == '?' :
      continue
    elif st[j] != '?' and st[j] == t[j] :
      continue
    c = 1
    break
  if c == 0 :
    s = s[:i-tl] + t + s[i:]
    break

if c == 1 :
  print('UNRESTORABLE')
else : 
  print(s.replace('?', 'a'))
Problem p04000 (python)

Fixed submission:
from collections import defaultdict
d = defaultdict(int)

h,w,n = map(int, input().split())
a = [0]*n
b = [0]*n
for i in range(n):
    a[i],b[i] = map(int, input().split())
    a[i] -= 1; b[i] -= 1
    
## 左上のマスを(0,0)とする
## 正方形の左上のマスを(j,i)とする
sq_i = []
sq_j = []

for x in range(n):
    for k in range(3):
        for l in range(3):
            i = a[x]-k ; j = b[x]-l
            if i<0 or i+3>h or j<0 or j+3>w:
                continue
            d[(j,i)] += 1

ans =[0]*10
for k,v in d.items():
    ans[v] += 1
ans[0] = (h-2)*(w-2)-sum(ans)

for i in range(10):
    print(ans[i])

Buggy submission (verdict: Runtime Error):
import numpy as np
h,w,n = map(int, input().split())
a = [0]*n
b = [0]*n
for i in range(n):
    a[i],b[i] = map(int, input().split())
    a[i] -= 1; b[i] -= 1
    
## 左上のマスを(0,0)とする
## 正方形の左上のマスを(j,i)とする
sq = [[0]*(w-2) for i in range(h-2)] 

for x in range(n):
    for k in range(3):
        for l in range(3):
            i = a[x]-k ; j = b[x]-l
            if i<0 or i+3>h or j<0 or j+3>w:
                continue
            sq[i][j] += 1

sq = np.array(sq)

for j in range(10):
    print(np.count_nonzero(sq == j))
Problem p02639 (python)

Fixed submission:
l = input().split()
ans = l.index('0') + 1
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())
if n != 1:
  arr = np.asarray([[int(x) for x in input().split()]])
  arrT = arr.T
  eye = np.eye(n)
  ans = np.count_nonzero(arrT % arr + eye == 0, axis=1)
  ans = np.count_nonzero(ans == 0)
  print(ans)
else:
  print(input())
Problem p02639 (python)

Fixed submission:
x1,x2,x3,x4,x5=map(int,input().split())
a=[]
a.append(x1)
a.append(x2)
a.append(x3)
a.append(x4)
a.append(x5)
for i in range(5):
    if a[i]==0:
        print(i+1)

Buggy submission (verdict: Runtime Error):
X, N = map(int, input().split())
p = list(map(int, input().split()))
for d in range(X + 1):
    for s in [-1, +1]:
        
        a = X + s * d
        if p.count(a) == 0:
            print(a)
            exit(0)

Buggy submission (verdict: Runtime Error):
X, N = map(int, input().split())
p = list(map(int, input().split()))
for d in range(X + 1):
    for s in [-1, +1]:
            a = X + s * d
			if p.count(a) == 0:
				print(a)
				exit(0)

Buggy submission (verdict: Runtime Error):
X, N = map(int, input().split())
p = list(map(int, input().split()))
for d in range(X + 1):
    for s in [-1, +1]:
            a = X + s * d
if p.count(a) == 0:
	print(a)
exit(0)
Problem p02641 (python)

Fixed submission:
X, N = map(int, input().split())
p = list(map(int, input().split()))
for d in range(X + 1):
    for s in [-1, +1]:
        
        a = X + s * d
        if p.count(a) == 0:
            print(a)
            exit(0)

Buggy submission (verdict: Runtime Error):
X, N = map(int, input().split())
p = list(map(int, input().split()))
for d in range(X + 1):
    for s in [-1, +1]:
            a = X + s * d
if p.count(a) == 0:
print(a)
exit(0)

Buggy submission (verdict: Runtime Error):
X, N = map(int, input().split())
p = list(map(int, input().split()))
for d in range(X + 1):
for s in [-1, +1]:
a = X + s * d
if p.count(a) == 0:
print(a)
exit(0)
Problem p02995 (python)

Fixed submission:
def gcd(x, y):
  while y!=0:
    x, y = y, x%y
  return x
def lcd(x, y):
    return x*y//gcd(x,y)
def C():
    a,b,c,d = list(map(int, input().split()))
    c_divide = b//c - (a-1)//c
    d_divide = b//d - (a-1)//d
    cd_lcd = lcd(c,d)
    lcd_divide = b//cd_lcd - (a-1)//cd_lcd
    print(b-a+1 - c_divide - d_divide + lcd_divide)
C()

Buggy submission (verdict: Runtime Error):
from math import gcd, floor, ceil
def lcd(x, y):
    return x*y//gcd(x,y)
def C():
    a,b,c,d = list(map(int, input().split()))
    c_divide = b//c - (a-1)//c
    d_divide = b//d - (a-1)//d
    cd_lcd = lcd(c,d)
    lcd_divide = b//cd_lcd - (a-1)//cd_lcd
    print(b-a+1 - c_divide - d_divide + lcd_divide)
C()
Problem p03763 (python)

Fixed submission:
def funuke():                                   
    N = int(raw_input())                        
    strs = []                                   
    for n in range(N):                          
        input_lines = raw_input()               
        strs.append(list(input_lines))          
    result = strs[0]                            
    for n in range(1,N):                        
        result = duplicate(result, strs[n])     
    result.sort()                               
    print("".join(result))                      
                                                
def duplicate(xs,ys):                           
    result = []                                 
    for x in xs:                                
        if x in ys:                             
            result.append(x)                    
            ys.remove(x)                        
    return result                               
                                                
                                                
if __name__=="__main__":                        
    funuke()

Buggy submission (verdict: Runtime Error):
#coding:utf-8

def funuke():
    N = input()
    strs = []
    for n in range(N):
        input_lines = input()
        strs.append(list(input_lines))
    result = strs[0]
    for n in range(1,N):
        result = duplicate(result, strs[n])
    result.sort()
    print("".join(result))

def duplicate(xs,ys):
    result = []
    for x in xs:
        if x in ys:
            result.append(x)
            ys.remove(x)
    return result


if __name__=="__main__":
    funuke()
Problem p02639 (python)

Fixed submission:
arr = input().split();
for i in range(5):
	if(int(arr[i]) == 0): print(i + 1)

Buggy submission (verdict: Runtime Error):
for i in range(5):
  if int(input()) == 0:
    print(i + 1)
Problem p02811 (python)

Fixed submission:
K,X = map(int,input().split())

if X <= 500*K:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
X,K = int(input())

if K >== 500*X:
    print("yes")
else:
    print("No")
Problem p02887 (python)

Fixed submission:
N = int(input())
S = list(input())

ans = 1
for i in range(N):
    if i == N - 1:
        print(ans)
    elif S[i] == S[i + 1]:
        i += 1
        continue
    else:
        ans += 1
        i += 1

Buggy submission (verdict: Runtime Error):
N = int(input())
S = list(input())

num = 1
ans = 1
for i in S:
    if i == S[num]:
        continue
    else:
        ans += 1
print(ans)
Problem p02910 (python)

Fixed submission:
S = str(input())

num = 0
for i in range(len(S)):
    if i % 2 == 0:
        if S[i] == "L":
            num += 1
    else:
        if S[i] == "R":
            num += 1

if num == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
S = str(input())

num = 0
for i in range(len(S)):
    if i % 2 == 0:
        if S[i] == "L":
            num += 1
    else:
        if s[i] == "R":
            num += 1

if num == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
S = list(input())

num = 0
for i in range(len(S)):
    if i % 2 == 0:
        if S[i] == "L":
            num += 1
    else:
        if s[i] == "R":
            num += 1

if num != 0:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
S = list(input())

if S[0] == "L" and S[2] == "L":
    print("No")
elif S[1] == "R" and S[3] == "R":
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
S = list(input())

if S[0] == "L" or S[2] == "L":
    print("No")
elif S[1] == "R" or S[3] == "R":
    print("No")
else:
    print("Yes")
Problem p02923 (python)

Fixed submission:
N = int(input())
H = list(map(int, input().split()))
 
ans = 0
tmp = 0
for i in range(N-1):
	if H[i] >= H[i+1]:
		tmp += 1
	else:
		if ans < tmp:
			ans = tmp
		tmp = 0
if ans < tmp:
	ans = tmp
 
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
N = int(input())
H = list(map(int, input().split()))
 
ans = 0
tmp = 0
for i in range(N-1):
	if H[i] >= H[i+1]:
		tmp += 1
	else:
		if ans < tmp:
			ans = tmp
		tmp = 0
if ans < tmp:
	ans = tmp
 
print(ans)
Problem p02945 (python)

Fixed submission:
A,B = map(int,input().split())

if A == 1 and B == 1:
    print(2)
elif A > 1 and B == 1:
    print(A+B)
elif A == 1 and B > 1:
    print(A+B)
elif A < 0 and B < 0:
    print(A*B)
elif A > 0 and B <= 0:
    print(A-B)
elif A <= 0 and B > 0:
    print(A+B) 
else:
    print(A*B)

Buggy submission (verdict: Runtime Error):
if A == 1 and B == 1:
    print(2)
elif A>0 and B>0 or A<0 and B==0:
    print(A*B)
elif A>=0 and B<0 or A==0 and B<0:
    print(A-B)
else:
    print(A+B)
Problem p02993 (python)

Fixed submission:
A = list(map(int,input()))


if A[0] == A[1] or A[1] == A[2] or A[2] == A[3]:
        print("Bad")
else:
        print("Good")

Buggy submission (verdict: Runtime Error):
N,L = list(map(int,input().split()))


i = 1
taste = []

while i <= N:
        taste.append(L + i - 1)
        i += 1


if L > 0 :
        print(sum(taste[1:N]))
elif L <= 0 and N + L < 0:
        print(sum(taste[0:N-1]))
elif L <= 0 and N + L >= 0:
        print(sum(taste[0:N-1]))

Buggy submission (verdict: Runtime Error):
N,L = list(map(int,input().split()))


i = 1
taste = []

while i == N:
        taste.append(L + i - 1)
        i += 1

if L > 0 :
        print(sum(taste[1:N]))
elif L < N and N + L < 0:
        print(sum(taste[0:N-1]))
elif L <= 0 and N - L >= 0:
        print(sum(taste))
Problem p03106 (python)

Fixed submission:
A,B,K = map(int,input().split())


split_num_list = []

for i in range(1,min(A,B)+1):
    if A % i == 0 and B % i == 0:
        split_num_list.append(i)
split_num_list.sort(reverse=True)
print(split_num_list[K-1])

Buggy submission (verdict: Runtime Error):
A,B,K = map(int,input().split())

split_num = 1
split_num_list = []

for i in range(1,min(A,B)+1):
    if A % i == 0 and B % i == 0:
        split_num_list.append(i)
print(split_num_list[K])
Problem p02830 (python)

Fixed submission:
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    s = input().strip().split()
    for i in range(N):
        print(s[0][i], end="")
        print(s[1][i], end="")
    print()


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    s = input().strip().split()
    for i in range(N):
        print(f"{s[0][i]}{s[1][i]}", end="")
    print()


if __name__ == "__main__":
    main()