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

Fixed submission:
N = int(input())
a = list(map(int,input().split()))
col = [0]*8
wild = 0
for i in a:
    if i//400 <= 7:
        col[i//400] = 1
    else:
        wild += 1
minimum = max(1,sum(col))
maximum = sum(col)+wild
print(minimum,maximum)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int,input().split()))
col = [0]*8
wild = 0
for i in a:
    if i//400 <= 7:
        col[i//400] = 1
    else:
        wild += 1
minimum = max(1,sum(col))
maximum = min(sum(col)+wild)
print(minimum,maximum)
Problem p03699 (python)

Fixed submission:
N = int(input())
s = sorted([int(input()) for _ in range(N)])
if sum(s)%10 != 0:
    print(sum(s))
else:
    for i in range(N):
        if s[i]%10 != 0:
            print(sum(s)-s[i])
            break
        if i == N-1:
            print(0)

Buggy submission (verdict: Runtime Error):
if sum(s)%10 != 0:
    print(sum(s))
else:
    for i in range(N):
        if s[i]%10 != 0:
            print(sum(s)-s[i])
            break
        if i == N-1:
            print(0)

Buggy submission (verdict: Runtime Error):
if sum(s)%10 != 0:
    print(sum(s))
else:
    for i in range(N):
        if s[i]%10 != 0:
            print(sum(s)-s[i])
            break
        if i == N-1:
            print(0)
Problem p03721 (python)

Fixed submission:
from operator import itemgetter
N,K = map(int,input().split())
ls = [list(map(int,input().split())) for _ in range(N)]
ls = sorted(ls,key=itemgetter(0))
len = 0
ans = 0
i = 0
while True:
    if len >= K:
        break
    ans = ls[i][0]
    len += ls[i][1]
    i += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
ls = []
len = 0
for i in range(N):
    a,b = map(int,input().split())
    ls.append(str(a)*b)
    len += b
    if len >= K:
        break
ls = "".join(ls)
print(ls[K-1])
Problem p03729 (python)

Fixed submission:
A,B,C = map(str,input().split())
if A[-1] == B[0] and B[-1] == C[0]:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
A,B,C = map(int,input().split())
if A[-1] == B[0] and B[-1] == C[0]:
    print("YES")
else:
    print("NO")
Problem p03730 (python)

Fixed submission:
A,B,C = map(int,input().split())
tmpA = A
tmp = []
while A%B != C and A%B not in tmp:
    tmp.append(A%B)
    A += tmpA
if A%B == C:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
start = time.time()
A,B,C = map(int,input().split())
flag = 0
if A == 1:
    flag = 1
else:    
    while flag == 0:
        if A%B == C:
            flag = 1
            break
        else:
            A += A
        now = time.time() - start
        if now > 1.9:
            break
if flag == 0:
    print("NO")
else:
    print("YES")
Problem p03853 (python)

Fixed submission:
H,W = map(int,input().split())
c = [input() for i in range(H)]
for j in range(H):
    print(c[j])
    print(c[j])

Buggy submission (verdict: Runtime Error):
H,W = map(int,input().split())
c = [input() for i in range(W)]
for j in range(W):
    print(c[j])
    print(c[j])
Problem p03147 (python)

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 20 20:52:23 2019

@author: Owner
"""

import collections
import scipy.misc
import sys
import numpy as np
import math
from operator import itemgetter
import itertools
import copy

#素因数を並べる
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table   
# 桁数を吐く
def digit(i):
    if i > 0:
        return digit(i//10) + [i%10]
    else:
        return []
    
def getNearestValueIndex(list, num):
    """
    概要: リストからある値に最も近い値のインデックスを取得する関数
    @param list: データ配列
    @param num: 対象値
    @return 対象値に最も近い値
    """

    # リスト要素と対象値の差分を計算し最小値のインデックスを取得
    idx = np.abs(np.asarray(list) - num).argmin()
    return idx

"""
N, X = map(int, input().split())

x = [0]*N
x[:] = map(int, input().split())

P = [0]*M
Y = [0]*M
for m in range(M):
    P[m], Y[m] = map(int, input().split())
    
all(nstr.count(c) for c in '753')
"""
N = int(input())

h = [0]*N
h[:] = map(int, input().split())

h = np.array(h)

cnt = 0
while np.sum(h ==0) != N:
    if np.sum(h ==0) == 0:        
        h = h-1
        cnt +=1
    else:
        r=N-1
        for n in range(N-1):
            if h[n] == 0 and h[n+1] !=0:
                l = n+1
            elif h[0] != 0:
                l = 0
            else:
                pass
            if h[n] != 0 and h[n+1] == 0:
                r = n
                break
        for x in range(l, r+1):
            h[x] = h[x] -1
        cnt +=1
print(cnt)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 20 20:52:23 2019

@author: Owner
"""

import collections
import scipy.misc
import sys
import numpy as np
import math
from operator import itemgetter
import itertools
import copy

#素因数を並べる
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table   
# 桁数を吐く
def digit(i):
    if i > 0:
        return digit(i//10) + [i%10]
    else:
        return []
    
def getNearestValueIndex(list, num):
    """
    概要: リストからある値に最も近い値のインデックスを取得する関数
    @param list: データ配列
    @param num: 対象値
    @return 対象値に最も近い値
    """

    # リスト要素と対象値の差分を計算し最小値のインデックスを取得
    idx = np.abs(np.asarray(list) - num).argmin()
    return idx

"""
N, X = map(int, input().split())

x = [0]*N
x[:] = map(int, input().split())

P = [0]*M
Y = [0]*M
for m in range(M):
    P[m], Y[m] = map(int, input().split())
    
all(nstr.count(c) for c in '753')
"""
N = int(input())

h = [0]*N
h[:] = map(int, input().split())

h = np.array(h)

cnt = 0
while np.sum(h ==0) != N:
    if np.sum(h ==0) == 0:        
        h = h-1
        cnt +=1
    else:
        for n in range(N-1):
            if h[n] == 0 and h[n+1] !=0:
                l = n+1
            elif h[0] != 0:
                l = 0
            else:
                pass
            if h[n] != 0 and h[n+1] == 0:
                r = n
                break
        for x in range(l, r+1):
            h[x] = h[x] -1
        cnt +=1
print(cnt)
Problem p03479 (python)

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 24 21:42:42 2019

@author: Owner
"""


X, Y = list(map(int, input().split()))
cnt = 0
for n in range(Y):
    if X*2**n ==Y:
        cnt = n +1
        break
    elif X*2**n >Y:
        cnt = n
        break
    else:
        pass

print(cnt)

Buggy submission (verdict: Runtime Error):
X, Y = list(map(int, input()))

print(Y//X)
Problem p02887 (python)

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

ans = 0

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

print(ans+1)

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

ans = 0

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

print(ans+1)
Problem p03085 (python)

Fixed submission:
n = input()

if n == 'A':
  print('T')
  
elif n == 'T':
  print('A')
  
elif n == 'C':
  print('G')
  
elif n == 'G':
  print('C')

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

if n == 'A':
  print('T')
  
elif n == 'T'
  print('A')
  
elif n == 'C'
  print('G')
  
elif n == 'G'
  print('C')

else:
  pass

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

if n == 'A':
  print('T')
  
elif n == 'T'
  print('A')
  
elif n == 'C'
  print('G')
  
elif n == 'G'
  print('C')
Problem p03155 (python)

Fixed submission:
n = int(input())
h = int(input())
w = int(input())

print((n-h+1)*(n-w+1))

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

print((n-h+1)*(n-w+1))
Problem p03363 (python)

Fixed submission:
import sys
import os
if sys.platform=="darwin":
	base = os.path.dirname(os.path.abspath(__file__))
	name = os.path.normpath(os.path.join(base, '../Documents/input.txt'))
	#print(name)
	sys.stdin = open(name)


#nCrの計算。nこの中から、r個を取り出す。
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

import copy


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

b = [0]*(n+1)
b[0] = 0
for i in range(1,n+1):
	b[i] = b[i-1] + a[i-1]

#print(b)

#c = [0]*(n+1)
#c = copy.copy(b)
#c = list(set(c))
#print(c)

import collections
c = collections.Counter(b)
#print(c)
#print(c.values())

ans = 0

for i in c.values():
	#print(i)
	#chk = b.count(i)

	#print(chk)
	if i >= 2:
		ans = ans + i*(i-1)//2

print(ans)

Buggy submission (verdict: Runtime Error):
import sys
import os
if sys.platform=="darwin":
	base = os.path.dirname(os.path.abspath(__file__))
	name = os.path.normpath(os.path.join(base, '../Documents/input.txt'))
	#print(name)
	sys.stdin = open(name)

#nCrの計算。nこの中から、r個を取り出す。
import import sys
import os
if sys.platform=="darwin":
	base = os.path.dirname(os.path.abspath(__file__))
	name = os.path.normpath(os.path.join(base, '../Documents/input.txt'))
	#print(name)
	sys.stdin = open(name)

#読み込みの高速化
input = sys.stdin.readline

#nCrの計算。nこの中から、r個を取り出す。
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

import copy


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

b = [0]*(n+1)
b[0] = 0
for i in range(1,n+1):
	b[i] = b[i-1] + a[i-1]

#print(b)

c = [0]*(n+1)
c = copy.copy(b)
c = list(set(c))
#print(c)

ans = 0

for i in c:
	#print(i)
	chk = b.count(i)
	#print(chk)
	if chk >= 2:
		ans = ans + combinations_count(chk,2)

print(ans)



def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

import copy


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

b = [0]*(n+1)
b[0] = 0
for i in range(1,n+1):
	b[i] = b[i-1] + a[i-1]

#print(b)

c = [0]*(n+1)
c = copy.copy(b)
c = list(set(c))
#print(c)

ans = 0

for i in c:
	#print(i)
	chk = b.count(i)
	#print(chk)
	if chk >= 2:
		ans = ans + combinations_count(chk,2)

print(ans)
Problem p03469 (python)

Fixed submission:

s = input()

#print(s)

#文字を置き換える
print(s.replace('2017', '2018'))

Buggy submission (verdict: Runtime Error):

# スペース区切りの整数の入力
n, y = map(int, input().split())

i = 0
j = 0
k = 0

l = [-1,-1,-1]
#print(l)

for i in reversed(range(0,n+1)):
    #print('i= %d' % i)
    if  y >= i*10000:
        for j in reversed(range(0,n-i+1)):
            #print('j= %d' % j)
            k = n - i - j
            #print('k= %d' % k)
            if  y == i*10000 + j*5000 + k*1000:
                l = [i, j, k]

#----ここは一つ見つかったら抜けるための命令
#                break
#        else:
#            continue
#        break
#------------------------------------

                #print(l)

print(l[0], l[1], l[2])

Buggy submission (verdict: Runtime Error):

# スペース区切りの整数の入力
n, y = map(int, input().split())

i = 0
j = 0
k = 0

l = [-1,-1,-1]
#print(l)

for i in reversed(range(0,n+1)):
    #print('i= %d' % i)
    if  y >= i*10000:
        for j in reversed(range(0,n-i+1)):
            #print('j= %d' % j)
            k = n - i - j
            #print('k= %d' % k)
            if  y == i*10000 + j*5000 + k*1000:
                l = [i, j, k]

#----ここは一つ見つかったら抜けるための命令
                break
        else:
            continue
        break
#------------------------------------

                #print(l)

print(l[0], l[1], l[2])

Buggy submission (verdict: Runtime Error):

# スペース区切りの整数の入力
n, y = map(int, input().split())

i = 0
j = 0
k = 0

l = [-1,-1,-1]
#print(l)

for i in reversed(range(0,n+1)):
    #print('i= %d' % i)
    if  y >= i*10000:
        for j in reversed(range(0,n-i+1)):
            #print('j= %d' % j)
            k = n - i - j
            #print('k= %d' % k)
            if  y == i*10000 + j*5000 + k*1000:
                l = [i, j, k]

#----ここは一つ見つかったら抜けるための命令
                break
        else:
            continue
        break
#------------------------------------

                #print(l)

print(l[0], l[1], l[2])
Problem p03477 (python)

Fixed submission:

# スペース区切りの整数の入力
a, b, c, d = map(int, input().split())

if a+b > c+d:
    print('Left')
elif a+b < c+d:
    print('Right')
else:
    print('Balanced')

Buggy submission (verdict: Runtime Error):

#import sys
#sys.setrecursionlimit(10000000)

def findSumOfDigits(n):
    sum = 0
    while n > 0.1:
        sum = sum + (n % 10)
        #print(n % 10)
        n = n - (n % 10)
        n = n / 10
    return sum

# 整数の入力
n = input()
n = int(n)

a = input()
a = int(a)

b = input()
b = int(b)

ans = 0

for i in range(1,n+1):
    #print(i)
    test = findSumOfDigits(i)
    if a <= test <= b:
        ans = ans + i

print(ans)

Buggy submission (verdict: Runtime Error):
def findSumOfDigits(n):
    sum = 0
    while n > 0.1:
        sum = sum + (n % 10)
        #print(n % 10)
        n = n - (n % 10)
        n = n / 10
    return sum

# 整数の入力
n = input()
n = int(n)

a = input()
a = int(a)

b = input()
b = int(b)

ans = 0

for i in range(1,n+1):
    #print(i)
    test = findSumOfDigits(i)
    if a <= test <= b:
        ans = ans + i

print(int(ans))

Buggy submission (verdict: Runtime Error):

import sys
sys.setrecursionlimit(10000000)

def findSumOfDigits(n):
    sum = 0
    while n > 0.1:
        sum = sum + (n % 10)
        #print(n % 10)
        n = n - (n % 10)
        n = n / 10
    return sum

# 整数の入力
n = input()
n = int(n)

a = input()
a = int(a)

b = input()
b = int(b)

ans = 0

for i in range(1,n+1):
    #print(i)
    test = findSumOfDigits(i)
    if a <= test <= b:
        ans = ans + i

print(int(ans))

Buggy submission (verdict: Runtime Error):

#import sys
#sys.setrecursionlimit(1000000)

def findSumOfDigits(n):
    sum = 0
    while n > 0.1:
        sum = sum + (n % 10)
        #print(n % 10)
        n = n - (n % 10)
        n = n / 10
    return sum

# 整数の入力
n = input()
n = int(n)

a = input()
a = int(a)

b = input()
b = int(b)

ans = 0

for i in range(1,n+1):
    #print(i)
    test = findSumOfDigits(i)
    if a <= test <= b:
        ans = ans + i

print(int(ans))

Buggy submission (verdict: Runtime Error):

import sys
sys.setrecursionlimit(1000000) 

def findSumOfDigits(n):
    sum = 0
    while n > 0.1:
        sum = sum + (n % 10)
        #print(n % 10)
        n = n - (n % 10)
        n = n / 10
    return sum

# 整数の入力
n = input()
n = int(n)

a = input()
a = int(a)

b = input()
b = int(b)

ans = 0

for i in range(1,n+1):
    #print(i)
    test = findSumOfDigits(i)
    if a <= test:
        if b >= test:
            ans = ans + i

print(int(ans))
Problem p03478 (python)

Fixed submission:

def findSumOfDigits(n):
    sum = 0
    while n > 0.1:
        sum = sum + (n % 10)
        #print(n % 10)
        n = n - (n % 10)
        n = n / 10
        #print(n)
    return sum

# スペース区切りの整数の入力
n, a, b = map(int, input().split())

ans = 0

for i in range(1,n+1):
    #print(i)
    test = findSumOfDigits(i)
    if a <= test <= b:
        ans = ans + i

print(ans)

Buggy submission (verdict: Runtime Error):

def findSumOfDigits(n):
    sum = 0
    while n > 0.1:
        sum = sum + (n % 10)
        #print(n % 10)
        n = n - (n % 10)
        n = n / 10
    return sum

# 整数の入力
n = input()
n = int(n)

a = input()
a = int(a)

b = input()
b = int(b)

ans = 0

for i in range(1,n+1):
    #print(i)
    test = findSumOfDigits(i)
    if a <= test:
        if b >= test:
            ans = ans + i

print(int(ans))

Buggy submission (verdict: Runtime Error):

def findSumOfDigits(n):
    sum = 0
    while n > 0.1:
        sum = sum + (n % 10)
        #print(n % 10)
        n = n - (n % 10)
        n = n / 10
    return sum

# 整数の入力
n = input()
n = int(n)

a = input()
a = int(a)

b = input()
b = int(b)

ans = 0

for i in range(1,n+1):
    #print(i)
    test = findSumOfDigits(i)
    if a <= test:
        if b >= test:
            ans = ans + i

print(int(ans))
Problem p03574 (python)

Fixed submission:
#テストファイルで実行する時
import sys
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')

def mine(s,i,j):
	
	ans = 0
	t = s[i-1][j-1]
	if t == '*' or t == '.':
		ans = ans + 0
	else:
		ans = ans + 1

	t = s[i-1][j]
	if t == '*' or t == '.':
		ans = ans + 0
	else:
		ans = ans + 1

	t = s[i-1][j+1]
	if t == '*' or t == '.':
		ans = ans + 0
	else:
		ans = ans + 1

	t = s[i][j-1]
	if t == '*' or t == '.':
		ans = ans + 0
	else:
		ans = ans + 1

	t = s[i][j+1]
	if t == '*' or t == '.':
		ans = ans + 0
	else:
		ans = ans + 1

	t = s[i+1][j-1]
	if t == '*' or t == '.':
		ans = ans + 0
	else:
		ans = ans + 1

	t = s[i+1][j]
	if t == '*' or t == '.':
		ans = ans + 0
	else:
		ans = ans + 1

	t = s[i+1][j+1]
	if t == '*' or t == '.':
		ans = ans + 0
	else:
		ans = ans + 1	

	return ans


h,w = map(int,input().split())
s = [str('*'+input())+'*' for i in range(h)]

test = ''
for i in range(w+2):
	test = test + '*' 

#リストsの頭にtestを追加
s.insert( 0,test)

#リストsの最後にtestを追加
s.insert(len(s),test)

#h行w列の2次元リストの初期化
s2 = [[0] * w for i in range(h)]
						
for i in range(1,h+1):
	for j in range(1,w+1):
		if s[i][j]=='*':
			pass
		elif s[i][j]=='#' :
			s2[i-1][j-1]='#'
		else:
			s2[i-1][j-1] = str(mine(s,i,j))

for i in range(h):
	print(''.join(s2[i]))

Buggy submission (verdict: Runtime Error):

# スペース区切りの整数の入力
h, w = map(int, input().split())


#　2次元行列のリストを作る。
list1 = [[0 for i in range(h)] for j in range(w)]
print(list1)

#list1[1][2] = 1
#list1[0][0] = "#"
#list1[1][1] = "."

#print(list1)
#print(list1[-1][-1])
#print(list1[0][0])

#list1[0:] = [int(input()) for i in range(h)]

#print(list1)

s = [0] * w

i = 0
for i in range(0,w):
	s[i] = input()

print(s)

print(list1)
print(list(s[0]))

list1[:][0] = list(s[0])
list1[:][1] = list(s[1])
list1[:][2] = list(s[2])

print(list1)



#list = [[int(i) for i in input().split()] for i in range(h)]

#print(list)
Problem p03605 (python)

Fixed submission:
n = int(input())

k = str(n)

#print(k[0])
#print(k[1])

if k[0]=='9' or k[1]=='9' :
	ans = 'Yes'
else:
	ans = 'No'
	
print(ans)

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

k = n//10

a = k%9
b = (n - 10*k)%9

if a == 0 or b == 0:
  ans = 'Yes'
else:
  ans = 'No'

print(ans)
Problem p03624 (python)

Fixed submission:
s = input()

#文字列をリスト化
s = list(s)
s = set(s)
s = sorted(s)

#print(s)

t = 'abcdefghijklmnopqrstuvwxyz'
t = list(t)
#print(t)

if s == t:
	print('None')
else:
	for i in range(len(t)):
		#print(i)
		if i == 25:
			print(t[i])
			break
		elif s[i]!=t[i]:
			print(t[i])
			break

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

#文字列をリスト化
s = list(s)
s = set(s)
s = sorted(s)

#print(s)

t = 'abcdefghijklmnopqrstuvwxyz'
t = list(t)
#print(t)

if s == t:
	print('None')
else:
	for i in range(len(t)):
		if s[i]!=t[i]:
			print(t[i])
			break
Problem p02612 (python)

Fixed submission:
print(abs((-int(input())%1000)))

Buggy submission (verdict: Runtime Error):
print(abs(-(N%1000)))
Problem p02717 (python)

Fixed submission:
X, Y, Z = map(str, input().split())
print(Z, X, Y)

Buggy submission (verdict: Runtime Error):
X, Y, X = map(str, input().split())
print(Z, X, Y)
Problem p02898 (python)

Fixed submission:
N, K, *H = map(int, open(0).read().split())
li = [i for i in H if i >= K]
print(len(li))

Buggy submission (verdict: Runtime Error):
N, K, *H = map(int, input().split())
count = 0
for i in range(H):
  if i >= K:
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
H = map(int, input().split())
count = 0
for i in range(H):
  if i >= K:
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
li = []
for i in range(N):
  li.append(int(input())

member = [ n for n in li if e >= K]
print(len(member))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
li = []
for i in range(N):
  li.append(int(input())

member = [ x for j in li if x >= K]
print(len(member))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
li = []
for i in range(N):
  li.append(int(input())

member = [ n for n in li if e >= K]
print(len(member))
Problem p02910 (python)

Fixed submission:
S = str(input())
for i in range(len(S)):
  if i % 2 == 0:
    if S[i] == 'L':
      print('No')
      exit()
    else:
      pass
  else:
    if S[i] == 'R':
      print('No')
      exit()
    else:
      pass
print('Yes')

Buggy submission (verdict: Runtime Error):
S = str(input())
odd = ""
even = ""
flag=0
for i in range(len(S)):
  if i % 2 == 0:
    odd += S[i]
  else:
    even += S[i]    
odd = list(set(odd))
even = list(set(even))

if len(odd) <= 3 and len(even) <= 3:
  for i in range(len(odd)):
    if (odd[i] == 'R') or (odd[i] == 'U') or (odd[i] == 'D'):
      pass
    else:
      flag=1
  for i in range(len(even)):
    if (odd[i] == 'L') or (odd[i] == 'U') or (odd[i] == 'D'):
      pass
    else:
      flag=1
  if flag==0:
    print('Yes')
  elif flag==1:
    print('No')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
S = str(input())
odd = ""
even = ""
flag=0
for i in range(len(S)):
  if i % 2 == 0:
    odd += S[i]
  else:
    even += S[i]    
odd = list(set(odd))
even = list(set(even))
if len(odd) <= 3 and len(even) <= 3:
  for i in range(len(odd)):
    if (odd[i] == 'R') or (odd[i] == 'U') or (odd[i] == 'D'):
      pass
    else:
      flag=1
  for i in range(len(even)):
    if (odd[i] == 'L') or (odd[i] == 'U') or (odd[i] == 'D'):
      pass
    else:
      flag=1
  if flag==0:
    print('Yes')
  else:
    print('No')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
S = str(input())
odd = ""
even = ""
flag=0
for i in range(len(S)):
  if i % 2 == 0:
    odd += S[i]
  else:
    even += S[i]    
odd = list(set(odd))
even = list(set(even))
if len(odd) <= 3 and len(even) <= 3:
  for i in range(len(odd)):
    if (odd[i] == 'R') or (odd[i] == 'U') or (odd[i] == 'D'):
      pass
    else:
      flag=1
  for i in range(len(even)):
    if (odd[i] == 'L') or (odd[i] == 'U') or (odd[i] == 'D'):
      pass
    else:
      flag=1
  if flag=0:
    print('Yes')
  else:
    print('No')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
S = str(input())
odd = ""
even = ""
flag=0
for i in range(len(S)):
  if i % 2 == 0:
    odd += S[i]
  else:
    even += S[i]    
odd = list(set(odd))
even = list(set(even))
if len(odd) == 3 and len(even) == 3:
  for i in range(len(odd)):
    if (odd[i] == 'R') or (odd[i] == 'U') or (odd[i] == 'D'):
      pass
    else:
      flag=1
  for i in range(len(even)):
    if (odd[i] == 'L') or (odd[i] == 'U') or (odd[i] == 'D'):
      pass
    else:
      flag=1
  if flag=0:
    print('Yes')
  else:
    print('No')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
S = str(input())
odd = ""
even = ""
flag=0
for i in range(len(S)):
  if i % 2 == 0:
    odd += S[i]
  else:
    even += S[i]    
odd = list(set(odd))
even = list(set(even))
if len(odd) == 3 and len(even) == 3:
  for i in range(len(odd)):
    if (odd[i] == 'R') or (odd[i] == 'U') or (odd[i] == 'D'):
      pass
    else:
      flag=1
  for j in range(len(even)):
    if (odd[i] == 'L') or (odd[i] == 'U') or (odd[i] == 'D'):
      pass
    else:
      flag=1
  if flag=0:
    print('Yes')
  else:
    print('No')
else:
  print('No')
Problem p02911 (python)

Fixed submission:
N, K, Q =map(int, input().split())
A = [int(input()) for _ in range(Q)]
point = [K-Q]*N

for i in range(Q):
  point[A[i]-1] += 1
  
for i in range(N):
  print('Yes' if point[i]>0 else 'No')

Buggy submission (verdict: Runtime Error):
N, K, Q =map(int, input().split())
A = [int(input()) for _ in range(Q)]
point = [K-Q]*N

for i in range(Q):
  point[A[i]-1] += 1
  
for i in range(N):
  print('Yes' if result[i]>0 else 'No')
Problem p02957 (python)

Fixed submission:
A, B = map(int, input().split())
if (A + B) % 2 == 0:
  k = (A + B) // 2
  print(k)
  exit()
else:
  print('IMPOSSIBLE')
  exit()

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
if abs(A-K) == abs(B-K):
  print(K)
else:
  print('IMPOSSIBLE')
Problem p02993 (python)

Fixed submission:
S = str(input())

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

Buggy submission (verdict: Runtime Error):
S = str(input())
for i in range(len(S)):
  if S[i]==S[i+1]:
    print('Good')
    break
  else:
    print('Bad')

Buggy submission (verdict: Runtime Error):
S = str(input())
for i in len(S):
  if S[i]==S[i+1]:
    print('Good')
    break
  else:
    print('Bad')