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

Fixed submission:
N,Q=map(int,input().split())
S=input()
A=[0]
res=0
for i in range(N):
  if i !=0:
    if S[i-1]=="A" and S[i]=="C":
      res+=1
      A.append(res)
    else:
      A.append(res)
for i in range(Q):
  l,r=map(int,input().split())
  print(A[r-1]-A[l-1])

Buggy submission (verdict: Runtime Error):
N,Q=map(int,input().split())
S=input()
for i in range(N):
  t=S[0:i+1].count("AC")
  A.append(t)
for i in range(Q):
  l,r=map(int,input().split())
  print(A[r-1]-A[l-1])

Buggy submission (verdict: Runtime Error):
N,Q=map(int,input().split())
S=input()
for i in range(N):
  A.append(S[0:i+1].count("AC"))
for i in range(Q):
  l,r=map(int,input().split())
  print(A[r-1]-A[l-1])
Problem p03102 (python)

Fixed submission:
N,M,C=map(int,input().split())
B=input().split()
res=0
for i in range(N):
  sum=C
  A=input().split()
  for j in range(M):
    sum+=int(B[j])*int(A[j])
  if sum>0:
    res+=1
print(res)

Buggy submission (verdict: Runtime Error):
N,M,C=map(int,input().split())
B=input().split()
res=0
for i in range(N):
  sum=C
  A=input().split()
  for j in range(M):
    sum+=int(B[i])*int(A[i])
    if sum>0:
      res+=1
print(res)
Problem p03238 (python)

Fixed submission:
N=input()
if N=="1":
  print("Hello World")
else:
  A=int(input())
  B=int(input())
  print(A+B)

Buggy submission (verdict: Runtime Error):
N=input()
A=int(input())
B=int(input())
if N=="1":
  print("Hello World")
else:
  print(A+B)
Problem p03251 (python)

Fixed submission:
N,M,X,Y=map(int,input().split())
x=list(int(i) for i in input().split())
y=list(int(i) for i in input().split())
if min(y)>max(x):
  if X<min(y):
    if Y>max(x):
      print("No War")
    else:
      print("War")
  else:
    print("War")
else:
  print("War")

Buggy submission (verdict: Runtime Error):
N,M,X,Y=map(int,input().split())
x=list(int(i) for i in input().split())
y=list(int(i) for i in input().split())
if min(y)>max(x):
  if X<min(y):
    if y>max(x):
      print("No War")
    else:
      print("War")
  else:
    print("War")
else:
  print("War")
Problem p03280 (python)

Fixed submission:
A,B=map(int,input().split())
print(A*B-A-B+ 1)

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = 0
for i in range(1, N + 1, 2):
    cnt = 0
    for j in range(1, i + 1):
        if not i % j: cnt += 1
    if cnt == 8: ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
ans=0
for i in range(1,N + 1,2):
    cnt=0
    for j in range(1,i+1):
        if not i%j:
          cnt+=1
    if cnt==8:
      ans += 1
print(ans)
Problem p03281 (python)

Fixed submission:
N=int(input())
ans=0
for i in range(1,N + 1,2):
    cnt=0
    for j in range(1,i+1):
        if not i%j:
          cnt+=1
    if cnt==8:
      ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
if N < 105:
  print(0)
elif N < 135:
  print(1)
elif N < 165
  print(2)
elif N < 189:
  print(3)
elif N < 195:
  print(4)
else:
  ptint(5)
Problem p03309 (python)

Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]
for i in range(N):
  A[i] -= i+1
A.sort()
b = A[N//2]
ans = 0
for a in A:
  ans += abs(b-a)
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(i) for i in input().split()]
B = []
for i in range(N):
  B.append(A[i]-i-1)
B.sort()
b = B[2//N]
ans = 0
for a in B:
  ans += abs(b-a)
print(ans)
Problem p03543 (python)

Fixed submission:
N = input()

if N[0] == N[1] == N[2] or N[1] == N[2] == N[3]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N=input()
res=0
for in range(1,10):
  if N.count("i")>=3:
    res+=1
    print("Yes")
if res==0:
  print("No")

Buggy submission (verdict: Runtime Error):
N=input()
res=0
for in range(1:10):
  if N.count("i")>=3:
    res+=1
    print("Yes")
if res==0:
  print("No")

Buggy submission (verdict: Runtime Error):
N=int(input())
res=0
for in range(1:10):
  if N.count(i)>=3:
    res+=1
    print("Yes")
if res==0:
  print("No")
Problem p03547 (python)

Fixed submission:
A,B=input().split()
if A < B:
  print("<")
elif A > B:
  print(">")
else:
  print("=")

Buggy submission (verdict: Runtime Error):
A,B=input().split
if A < B:
  print("<")
elif A > B:
  print(">")
else:
  print("=")

Buggy submission (verdict: Runtime Error):
A,B=input().split
if A<B:
  print("<")
elif A>B:
  print(">")
else:
  print("=")

Buggy submission (verdict: Runtime Error):
A,B=map(input().split)
if A<B:
  print("<")
elif A>B:
  print(">")
else:
  print("=")
Problem p03597 (python)

Fixed submission:
N=int(input())
A=int(input())
print(N*N-A)

Buggy submission (verdict: Runtime Error):
N=int,input()
A=int,input()
print(N*N-A)

Buggy submission (verdict: Runtime Error):
N=input()
A=input()
print(N*N-A)

Buggy submission (verdict: Runtime Error):
N,A=map(int,input().split())
print(N*N-A)
Problem p03605 (python)

Fixed submission:
N=input()
if N.count("9")>=1:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N=input()
if N.count(9)>=1:
  print("Yes")
else:
  print("No")
Problem p03711 (python)

Fixed submission:
x, y = map(int, input().split())
a = [1,3,5,7,8,10,12]
b = [4,6,9,11]
if (x in a and y in a) or (x in b and y in b):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a==1 or a==3 or a==5 or a==7 or a==8 or a==10 or a==12:
  if b==1 or b==3 or b==5 or b==7 or b==8 or b==10 or b==12:
    print("Yes")
  else:
    print("No")
if a==4 or a==6 or a==9 or a=11:
  if b==2 or b==6 or b==9 or b==11
    print("Yes")
  else:
    print("No")
if a==2:
  if b==2:
    print("Yes")
  else:
    print("No")
Problem p03719 (python)

Fixed submission:
A,B,C=map(int,input().split())
if A<=C and B>=C:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
A,B,C=map(input().split())
if A<=C and B>=C:
  print("Yes")
else:
  print("No")
Problem p03826 (python)

Fixed submission:
A,B,C,D=map(int,input().split())
if A*B<C*D:
  print(C*D)
else :
  print(A*B)

Buggy submission (verdict: Runtime Error):
A,B,C,D=map(int,input().spliT())
if A*B<C*D:
  print(C*D)
else :
  print(A*B)
Problem p03860 (python)

Fixed submission:
a,b,c=input().split()
print(a[0]+b[0]+c[0])

Buggy submission (verdict: Runtime Error):
a,b,c=map(input().split())
print(a[0]+b[0]+c[0])

Buggy submission (verdict: Runtime Error):
a,s,b=input(),split()
print(a(0)+c(0)+b(0))

Buggy submission (verdict: Runtime Error):
a,s,b=map(input(),split())
print(a(0)+c(0)+b(0))

Buggy submission (verdict: Runtime Error):
a,s,b=map(input(),split())
print(a(1)+c(1)+b(1))
Problem p03943 (python)

Fixed submission:
a,b,c=map(int,input().split())
if a+b==c or a+c==b or b+c==a:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if a+b==c || a+c==b || b+c==a:
  print("Yes")
else:
  print("No")
Problem p03997 (python)

Fixed submission:
a=int(input())
b=int(input())
h=int(input())
print(int((a+b)*h/2))

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
h=int(input())
print((A+B)*h/2)
Problem p04029 (python)

Fixed submission:
Sum=0
N=int(input())
for i in range(N):
  Sum+=i+1
print(Sum)

Buggy submission (verdict: Runtime Error):
Sum=0
for i in range(N):
  Sum+=i+1
print(Sum)
Problem p04043 (python)

Fixed submission:
M=list(map(int,input().split()))
if M.count(5)==2 and M.count(7)==1:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
A,B,C=map.(int,input().split())
if A+B==10 or A+B==12:
  if A+C==10 or A+C==12:
    if B+C==10 or B+C==12:
      print("YES")
    else:
      print("NO")

Buggy submission (verdict: Runtime Error):
A,B,C=map.(int,input().split())
if A+B==10 or A+B==12:
  if A+C==10 or A+C==12:
    if B+C==10 or B+C==12:
      
      print("YES")
    else:
      print("NO")
Problem p03308 (python)

Fixed submission:
n = int(input())
a = [int(num) for num in input().split()]
m = 0
for i in range(n):
  for j in range(n):
    m = max(m,abs(a[i]-a[j]))
print(m)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(num) for num in input().split()]
m = 0
for i in range(n):
  for j in range(n):
    m = max(max,abs(a[i]-a[j]))
print(m)
Problem p03316 (python)

Fixed submission:
s = input()
n = int(s)
sum =0
mir = n
for i in range(len(s)):
  sum += int(s[i])
if n%sum ==0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s = input()
n = int(s)
sum =0
mir = n
for i in range(len(s)):
  sum += s[i]
if n%sum ==0:
  print("Yes")
else:
  print("No")
Problem p03588 (python)

Fixed submission:
n = int(input())
a =0
b =0
for i in range(n):
    nums = [int(num) for num in input().split()]
    aa = nums[0]
    bb = nums[1]
    if aa > a:
        a = aa
        b = bb
print(a + b)

Buggy submission (verdict: Runtime Error):
n = int(input())
a =0
b =0
for i in range(n):
    nums = [int(num) for num in input().split]
    aa = nums[0]
    bb = nums[1]
    if aa > a:
        a = aa
        b = bb
print(a + b)
Problem p03330 (python)

Fixed submission:
from pprint import pprint

# --- データ読み込み ---
N, C = [int(i) for i in input().split()]
D_xy = []
for _ in range(C):
    D_xy.append([int(i) for i in input().split()])
c_ij = []
for _ in range(N):
    c_ij.append([int(i) for i in input().split()])

# --- 読み込み結果確認 ---
# pprint(D_xy)
# pprint(c_ij)

# --- 各クラスタに分類 ---
clusters = [[] for _ in range(3)]
for i in range(N):
    for j in range(N):
         if (i+j) % 3 == 0:
             clusters[0].append(c_ij[i][j])
         elif (i+j) % 3 == 1:
             clusters[1].append(c_ij[i][j])
         elif (i+j) % 3 == 2:
             clusters[2].append(c_ij[i][j])
         else:
             # print(i+j % 3) # % の前は()でくくらないと順番が狂う
             # print("Something wrong")
             pass

# まずは，各クラスタをある色にするために必要なコストを計算する
# つまり， clusters[i] to c の距離を予め計算する
cost_matrix = [[0 for _ in range(C)] for _ in range(3)]
# print(cost_matrix)
for i in range(3):
    for c in range(C):
        cost = 0
        for item in clusters[i]:
            cost += D_xy[item-1][c] # item-1 が index に対応
        # print(i,c)
        cost_matrix[i][c] = cost

# print("cost_matrix")
# pprint(cost_matrix)

## cost_matrixの中から一番賢い組み合わせを選択する
min = float('infinity')
for i in range(C):
    for j in range(C):
        if j == i:
            continue
        for k in range(C):
            if k == i or k == j:
                continue
            score = cost_matrix[0][i] + cost_matrix[1][j] + cost_matrix[2][k]
            # print(i,j,k,"score:",score)
            if score < min:
                min = score
print(min)

Buggy submission (verdict: Runtime Error):
from pprint import pprint
N, C = [int(i) for i in input().split()]
D_xy = []
for _ in range(C):
    D_xy.append([int(i) for i in input().split()])
c_ij = []
for _ in range(N):
    c_ij.append([int(i) for i in input().split()])

# pprint(D_xy)
# pprint(c_ij)

clusters = [[] for _ in range(3)]
for i in range(N):
    for j in range(N):
         if (i+j) % 3 == 0:
             clusters[0].append(c_ij[i][j])
         elif (i+j) % 3 == 1:
             clusters[1].append(c_ij[i][j])
         elif (i+j) % 3 == 2:
             clusters[2].append(c_ij[i][j])
         else:
             # print(i+j % 3) # % の前は()でくくらないと順番が狂う
             # print("Something wrong")
             pass

# 色が c 通りある場合，色の組み合わせは およそ c**3 通りある訳だけれども．
# 現実的なアプローチとしては，まずそれっぽい解を見つける．
# 他の候補は，計算過程でその最小値を超えたらpassするみたいな感じで進めるのが良いのかな?

cost_matrix = [[0 for i in range(3)] for j in range(C)] # cluster_i to c の距離を予め計算する
for i in range(3):
    for c in range(C):
        cost = 0
        for item in clusters[i]:
            cost += D_xy[item-1][c] # item-1 が index に対応
        cost_matrix[i][c] = cost

# print("cost_matrix")
# pprint(cost_matrix)

## cost_matrixの中から一番賢い組み合わせを選択する
min = float('infinity')
for i in range(C):
    for j in range(C):
        if j == i:
            continue
        for k in range(C):
            if k == i or k == j:
                continue
            score = cost_matrix[0][i] + cost_matrix[1][j] + cost_matrix[2][k]
            # print(i,j,k,"score:",score)
            if score < min:
                min = score
print(min)
Problem p03351 (python)

Fixed submission:
a, b, c, d = [int(i) for i in input().split()]
# abの通信可能性判定
if abs(a - b) <= d:
    ab = True
else:
    ab = False
# bcの通信可能性判定
if abs(b - c) <= d:
    bc = True
else:
    bc = False
# acの通信可能性判定
if abs(a - c) <= d:
    ac = True
else:
    ac = False

if ac == True or (ab == True and bc == True):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
candidate = []
# べき乗リストを更新する
for i in range(32):
    if i >= 1:
        for j in range(32):
            if i**j <= 1000:
                if j > 1:
                    if i**j not in candidate:
                        candidate.append(i**j)
            else:
                break

candidate = sorted(candidate)
x = int(input())
result = 1
for c in candidate[1:]:
    if x >= c:
        result = c
    else:
        break
print(result)
Problem p03353 (python)

Fixed submission:
s = input()
k = int(input())
subs = []
for i in range(len(s)):
    for j in range(5):
        if s[i:i+j+1] not in subs:
            subs.append(s[i:i+j+1])
subs = sorted(subs)
# print(subs)
print(subs[k-1])

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())
subs = []
for i in range(len(s)):
    for j in range(4):
        if s[i:i+j+1] not in subs:
            subs.append(s[i:i+j+1])
subs = sorted(subs)
print(subs[k-1])

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())
subs = []
for i in range(len(s)):
    for j in range(len(s)):
        if j > i:
            if j - i > 5:
                break
            if s[i:j] not in subs:
                subs.append(s[i:j])
            # print(i,j)
if len(s) <= 5:
    subs.append(s)
# print(sorted(subs))
print(sorted(subs)[k-1])

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())
subs = []
for i in range(len(s)):
    for j in range(len(s)):
        if j > i:
            if s[i:j] not in subs:
                subs.append(s[i:j])
            # print(i,j)

subs.append(s)

print(sorted(subs)[k-1])
Problem p03853 (python)

Fixed submission:
h, w = map(int, input().split())
image = []
for i in range(h):
    image.append(input())
for row in image:
    print(row+"\n"+row)

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
image = []
for i in h:
    image.append(input().split())
for row in image:
    print(row+"\n"+row)
Problem p03504 (python)

Fixed submission:
N, C = map(int, input().split(' '))

ss = [0] * N
tt = [0] * N
cc = [0] * N

for n in range(N):
    ss[n], tt[n], cc[n] = map(int, input().split(' '))

L = 10 ** 5 * 2 + 2
timeline = [[0] * L for c in range(C)]

# print(len(timeline), len(timeline[0]))

# 同じチャンネルでマージ
for n in range(N):
    timeline[cc[n] - 1][ss[n] * 2] += 1
    timeline[cc[n] - 1][tt[n] * 2] -= 1

# チャンネルのスタート時間0.5ずらして一個前のところに
num = [0] * L
for c in range(C):
    for t in range(L):
        if timeline[c][t] > 0:
            num[t - 1] += timeline[c][t]
        if timeline[c][t] < 0:
            num[t] += timeline[c][t]

stack = 0
max_ = 0
for i in range(L):
    stack += num[i]
    if stack > max_:
        max_ = stack

print(max_)
# 3 2
# 1 3 1
# 3 4 1
# 4 5 2

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

ss = [0 ] * N
tt = [0 ] * N
cc = [0 ] * N

for n in range(N):
    ss[n], tt[n], cc[n] = map(int, input().split(' '))

timeline = [0] * (10 ** 5)

for n in range(N):
    timeline[ss[n] - 1] += 1
    timeline[tt[n]] -= 1

max_ = 0
stack = 0
for t in timeline:
    stack += t
    if stack > max_:
        max_ = stack
        
print(max_)
Problem p03079 (python)

Fixed submission:
inp = [int(n) for n in input().split(" ")]
res = inp[0] == inp[1] and inp[0] == inp[2] and 1 <= inp[0] <= 100

if res:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
inp = input().split(" ")

print(inp[0] == inp[1] and inp[0] == inp[2] and 1 <= inp[0] <= 100)
Problem p03079 (python)

Fixed submission:
import sys

sides = sys.stdin.readlines()

a, b, c = sides[0].split()

if a == b == c:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
from sys import stdin

sides = stdin.read().split()

if sides[0] == sides[1] == sides[2]:
  print(Yes)
else:
  print(No)
Problem p03079 (python)

Fixed submission:
print_val = "No"
 
A, B, C = map(int, raw_input().split())

if A == B and B == C:
  print_val = "Yes"

print print_val

Buggy submission (verdict: Runtime Error):
import sys
input_list = sys.stdin.readlines() 
N, s = map(str.strip, input_list)
red_hat_counter = 0
for s_str in s:
  if s_str == "R":
    red_hat_counter += 1

if red_hat_counter > (int(N)%2):
  print "Yes"
else:
  print "No"

Buggy submission (verdict: Runtime Error):
print_val = "No"
 
A,B,C = map(int, input().split())
if A == B and B == C:
  print_val = "Yes"
print print_val

Buggy submission (verdict: Runtime Error):
print_val = "False"

A,B,C = map(int, input().split())
if A == B and B == C:
  print_val = "True"
print print_val

Buggy submission (verdict: Runtime Error):
def is_value_validated(number):
  is_validated = False

  if type(number) !== "number":
    return retrun_value
  retrun_value = True
  return retrun_value

def is_triangle_exist(A, B, C):
  printed_value = "No"
  if is_value_validated(A) or \
    is_value_validated(B) or \
    is_value_validated(C):
    print printed_value
    return -1

  if A==B and B==C:
    printed_value = "Yes"
  print printed_value
Problem p03080 (python)

Fixed submission:
import sys
input_list = sys.stdin.readlines() 
N, s = map(str.strip, input_list)
red_hat_counter = 0
for s_str in s:
  if s_str == "R":
    red_hat_counter += 1
if red_hat_counter > (int(N)/2):
  print "Yes"
else:
  print "No"

Buggy submission (verdict: Runtime Error):
import sys

N, s = sys.stdin.read().split('\n')

red_hat_counter = 0
blue_hat_counter = 0

for s_char in s:
  if s_char == "R":
    red_hat_counter += 1
  else:
    blue_hat_counter += 1

if red_hat_counter > blue_hat_counter :
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
import sys

N, s = sys.stdin.read().split('\n')

red_hat_counter = 0
blue_hat_counter = 0

# Get a counter of Red
for s_char in s:
  if s_char == "R":
    red_hat_counter += 1
  else:
    blue_hat_counter += 1

# Compare between a criteria value and a counter of Red
if red_hat_counter > blue_hat_counter :
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
import sys

_, s = sys.stdin.read().split('\n')
red_hat_counter = 0
blue_hat_counter = 0


# Get a counter of Red
for s_char in s:
  if s_char == "R":
    red_hat_counter += 1
  else:
    blue_hat_counter += 1

# Compare between a criteria value and a counter of Red
if blue_hat_counter < red_hat_counter:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
import sys

_, s = sys.stdin.read().split('\n')
red_hat_counter = 0
blue_hat_counter = 0

# Get a criteria value from N
#criteria_val = ceil(int(N)/2)


# Get a counter of Red
for s_char in s:
  if s_char == "R":
    red_hat_counter += 1
  else:
    blue_hat_counter += 1
    
# Compare between a criteria value and a counter of Red
if blue_hat_counter < red_hat_counter:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
import sys
from math import ceil

N, s = sys.stdin.read().split('\n')
red_hat_counter = 0

# Get a criteria value from N
criteria_val = ceil(int(N)/2)
print(criteria_val)


# Get a counter of Red
for s_char in s:
  if s_char == "R":
    red_hat_counter += 1
    
# Compare between a criteria value and a counter of Red
if criteria_val < red_hat_counter:
  print("Yes")
else:
  print("No")
Problem p03455 (python)

Fixed submission:
a = list(map(int,input().split()))
 
if (a[0]*a[1])%2==0:
	print("Even")
else:
	print("Odd")

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

if (a*b)%2==0:
	print("Even")
else:
	print("Odd")
Problem p03079 (python)

Fixed submission:
x = input()
inputs = x.split()
a, b, c = int(inputs[0]), int(inputs[1]), int(inputs[2])

if a == b and b == c:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
num = int(input())
seq = input()
num_R = seq.count('R')
if num_R > num // 2:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
x = input()
inputs = x.split()
a, b, c = int(inputs[0]), int(inputs[1]), int(inputs[2])
if a == b and b == c:
  return 'Yes'
else:
  return 'No'

Buggy submission (verdict: Runtime Error):
x = input()
inputs = x.split()
a, b, c = int(inputs[0]), int(inputs[1]), int(inputs[2])
if a = b and b = c:
  return 'Yes'
else:
  return 'No'

Buggy submission (verdict: Runtime Error):
inputs = input()
a, b, c = inputs.split()
if a == b and b == c:
  return 'YES'
else:
  return 'No'

Buggy submission (verdict: Runtime Error):
inputs = input()
a, b, c = input.split()
if a == b and b == c:
  return 'YES'
else:
  return 'No'
Problem p03080 (python)

Fixed submission:
num = int(input())
seq = input()
num_R = seq.count('R')
if num_R > num // 2:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
num = input()
seq = input()
num_R = seq.count(R)
if num_R > num // 2:
  print('Yes')
else:
  print('No')
Problem p03826 (python)

Fixed submission:
a,b,c,d = map(int,input().split())
print(max(a*b, c*d))

Buggy submission (verdict: Runtime Error):
a = int(input()) 
b = int(input())
c = int(input())
d = int(input())
print(max(a*b, c*d))

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
if a*b > c*d:
    print(a*b)
else:
    print(c*d)
Problem p03079 (python)

Fixed submission:

a,b,c = map(int,input().split())
if (a==b and b==c):
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
if (a==b and b==c)
	print("Yes")
else
	print("No")
Problem p03150 (python)

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

for i in range(n):
  for j in range(i,n):
    tmp = s[:i]+s[j:]
    if tmp == 'keyence':
      print('YES')
      exit()
print('NO')

Buggy submission (verdict: Runtime Error):
# -*- coding:utf-8 -*-
input_str = input()
target_lst = ['k','e','y','e','n','c','e']

i = 0
del_list = []
for elm in input_str:
  if elm in target_lst:
    target_lst.remove(elm)
    del_list.append(i)
  i+=1

if len(target_lst) !=  0:
  print('NO')
else:
  for i in del_list:
    if i == 0:
      continue
    else:
      if del_list[i] < del_list[i-1]:
        print('NO')
        exit()

  print('YES')
Problem p03079 (python)

Fixed submission:
if __name__ == '__main__':
	a, b, c = list(map(int, input().split(' ')))
	if a == b and b == c:
		print('Yes')
	else:
		print('No')

Buggy submission (verdict: Runtime Error):
if __name__ == '__main__':
	a, b, c = map(int, input().split(' '))
    if a == b and b == c:
		print('Yes')
	else:
		print('No')
Problem p03262 (python)

Fixed submission:
#!/usr/bin/env python3
# Skip
from fractions import gcd
from functools import reduce

def gcd_list(numbers):
    return reduce(gcd, numbers)

i = input().split(' ')
N = int(i[0])
X = int(i[1])
xs = list(map(lambda x: int(x), input().split(' ')))
ds = list(map(lambda x: abs(X-x), xs))
#print(xs)
#print(ds)
l = gcd_list(ds)
print(l)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
# Skip
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

i = input().split(' ')
N = int(i[0])
X = int(i[1])
xs = list(map(lambda x: int(x), input().split(' ')))
ds = list(map(lambda x: abs(X-x), xs))
#print(xs)
#print(ds)
l = gcd_list(ds)
print(l)