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

Fixed submission:
# input
S = input()
# judge and print
if S[0]==S[1] and S[1]==S[2]:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
S = input()
Q = int(input())
head = True # True: left side is head
for i in range(Q):
  Query_i = list(map(str, input().split()))
  if Query_i[0]=='1':
    head = not head
  elif Query_i[1] == '1' and head:
    S = Query_i[2] + S
  elif Query_i[1] == '1' and not head:
    S = S + Query_i[2]
  elif Query_i[1] == '2' and head:
    S = S + Query_i[2]
  else Query_i[1] == '2' and not head:
    S = Query_i[2] + S
  if not head:
    S = S[::-1]
print(S)

Buggy submission (verdict: Runtime Error):
S = input()
Q = int(input())
for i in range(Q):
  Query_i = list(map(str, input().split()))
  if Query_i[0]=='1':
    S = S[::-1]
  elif Query_i[1] == '1':
    S = Query_i[2] + S
  else:
    S = S + Query_i[2]
print(S)
Problem p02723 (python)

Fixed submission:
def solve():
  val = str(input())
  if val[2] == val[3] and val[4] == val[5]:
    print('Yes')
  else:
    print('No')
solve();

Buggy submission (verdict: Runtime Error):
def solve():
  val = str(input())
  return val[2] == val[3] && val[4] == val[5]
solve();
Problem p02725 (python)

Fixed submission:
def solve():
  raw = input().split()
  K = int(raw[0])
  N = int(raw[1])
  vals = [None] * N
  ans = 99999999
  raw = input().split()
  for i in range(N):
    vals[i] = int(raw[i])
  for i in range(N):
    cc = -1
    if i == 0:
      cc = vals[N-1] - vals[0]
    else:
      cc = vals[i-1] + K - vals[i]
    ans = min(ans, cc)
  print(ans)
solve()

Buggy submission (verdict: Runtime Error):
def solve():
  K = int(input())
  N = int(input())
  vals = [None] * N
  ans = 99999999
  for i in range(N):
    vals[i] = int(input())
  for i in range(N):
    cc = -1
    if i == 0:
      cc = vals[N-1] - vals[0]
    else:
      cc = vals[i-1] + K - vals[i]
    ans = min(ans, cc)
  print(ans)
solve()
Problem p02723 (python)

Fixed submission:
num = input()
if num[2] == num[3] and num[-1] == num[-2]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
if num[2] == num[3] and num[-1] == num[-2]:
    print('Yes')
else:
    print('No')
Problem p02723 (python)

Fixed submission:
import sys

for S in sys.stdin:
    if(S[2]==S[3] and S[4]==S[5]):
        print("Yes")
    else:
        print ("No")

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

N,X,Y = [int(c) for c in input().split()]


res=[0]*N        
for x in range(0,N):
    for y in range(x,N):
        #print(x,y,abs(x-y),abs(abs(X-1-x)+abs(Y-1-y)+1),min(abs(x-y),abs(abs(X-1-x)+abs(Y-1-y)+1)))
        r=min(abs(x-y),abs(abs(X-1-x)+abs(Y-1-y)+1))
        res[r]=res[r]+1
        if(x>y):
            res[r]=res[r]-1


for i in range(1,N):
    print(res[i])

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

N,X,Y = [int(c) for c in input().split()]


res=[0]*N        
for x in range(0,N):
    for y in range(0,N):
        #print(x,y,abs(x-y),abs(abs(X-1-x)+abs(Y-1-y)+1),min(abs(x-y),abs(abs(X-1-x)+abs(Y-1-y)+1)))
        r=min(abs(x-y),abs(abs(X-1-x)+abs(Y-1-y)+1))
        res[r]=res[r]+1
        if(x>y):
            res[r]=res[r]-1


for i in range(1,N):
    print(res[i])

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

N,X,Y = [int(c) for c in input().split()]


res=[0]*N        
for x in range(0,N):
    for y in range(0,N):
        #print(x,y,abs(x-y),abs(abs(X-1-x)+abs(Y-1-y)+1),min(abs(x-y),abs(abs(X-1-x)+abs(Y-1-y)+1)))
        r=min(abs(x-y),abs(abs(X-1-x)+abs(Y-1-y)+1))
        res[r]=res[r]+1
        if(x>y):
            res[r]=res[r]-1


for i in range(1,N):
    print(res[i])
Problem p02725 (python)

Fixed submission:
from sys import stdin, stdout  

K, N = [int(c) for c in input().split()]
A = [int(c) for c in input().split()]
dist=[]
for i in range(0,N-1):
    dist.append(A[i+1]-A[i])
dist.append(abs(A[0]-A[-1]+K))

m=max(dist)
for idx,val in enumerate(dist):
    if(val==m):
        dist[idx]=0
        break
print(sum(dist))

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

n = stdin.readline() 
arr = [int(x) for x in stdin.readline().split()] 
K=arr[0]
N=arr[1]
n = stdin.readline() 
A = [int(x) for x in stdin.readline().split()] 
dist=[]
for i in range(0,N-1):
    dist.append(A[i+1]-A[i])
dist.append(abs(A[0]-A[-1]+K))

m=max(dist)
for idx,val in enumerate(dist):
    if(val==m):
        dist[idx]=0
        break
print(sum(dist))
Problem p02725 (python)

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

per_dist = list(A[i+1]-A[i] for i in range(0,N-1))
last_dist = A[0] + K - A[N - 1]
type(last_dist)
per_dist.append(last_dist)
max_dist = max(per_dist)
print(K - max_dist)

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

per_dist = list(A[i+1]-A[i] for i in range(0,N-1))
last_dist = A[0] + K - A[N - 1]
per_dist = per_dist.append(last_dist)
max_dist = max(per_dist)
print(K - max_dist)

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

per_dist = list(A[i+1]-A[i] for i in range(0,N-1))
last_dist = A[0] + K - A[N]
per_dist = per_dist.append(last_dist)
max_dist = max(per_dist)
print(K - max_dist)
Problem p02723 (python)

Fixed submission:
S = str(input())
if S[2]==S[3] and S[4]==S[5]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S = str(input())
if S[2]==S[3] & S[4]==S[5]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s = str(input())
if s[2]==s[3] & s[4]==s[5]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s = str(input())
if s[2]=s[3] & s[4]=s[5]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s = input()
if s[2]=s[3] && s[4]=s[5]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s = input()
if s[3]=s[4] && s[5]=s[6]:
  print("Yes")
else:
  print("No")
Problem p02753 (python)

Fixed submission:
import sys
input = sys.stdin.readline
s = input()

if  s[0] == s[1] == s[2]:
    print("No")
else:
    print("Yes")

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

if  a[0] == a[1] == a[2]:
    print("Np")
else:
    print("Yse")

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

s = [import()] 

if  a[0] == a[1] == a[2]:
	print("Yes")
else:
	print("No")
Problem p03072 (python)

Fixed submission:
n = int(input())
l = [int(x) for x in input().split()]
max_h = l[0]
result = 1
for i in range(1,n):
    if max_h <= l[i]:
        result += 1
        max_h = l[i]
    else:
        continue
print(result)

Buggy submission (verdict: Runtime Error):
n = int(intput_n)
l = [int(x) for x in input_l.split()]
max_h = l[0]
result = 1
for i in range(1,n):
    if max_h <= l[i]:
        result += 1
        max_h = l[i]
    else:
        continue
print(result)

Buggy submission (verdict: Runtime Error):
n = int(input()
l = map(int, input().split())
max_h = l[0]
result = 1
for i in range(1,n):
    print(max_h, l[i])
    if max_h <= l[i]:
        result += 1
        max_h = max(l[:i])
    else:
        continue
print(result)
Problem p03075 (python)

Fixed submission:
l = [int(input()) for _ in range(5)]
max_distance = int(input())
distance = l[-1] - l[0]
if max_distance >= distance:
  print("Yay!")
else:
  print(":(")

Buggy submission (verdict: Runtime Error):
l = [int(input()) for _ in range(5)]
max_distance = input()
l[-1] - l[0] = distance
if max_distance > distance:
  print("Yay!")
else:
  print(":(")
Problem p03077 (python)

Fixed submission:
from math import ceil

n = int(input())
l = [int(input()) for _ in range(5)]

print(ceil(n/min(l)) + 4)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = [int(input()) for _ in range(5)]

print(ceil(n%min(l)) + 4)
Problem p02723 (python)

Fixed submission:
# -*- coding: utf-8 -*-

s = input()

if s[2] == s[3] and s[4] == s[5]:
    print("Yes")
else:
    print("No")

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

x, y, a, b, c = [int(x) for x in stdin.readline().rstrip().split()]

p = [int(x) for x in stdin.readline().rstrip().split()]
q = [int(x) for x in stdin.readline().rstrip().split()]
r = [int(x) for x in stdin.readline().rstrip().split()]


ps = sorted(p, reverse=True)
qs = sorted(q, reverse=True)

pss = ps[0:x]
pss.extend(qs[0:y])

he = 0

for i in range(x+y):
    for j in range(len(r)):
        if pss[i] < r[j]:
            pss[i] = r.pop(j)
            break
    he += pss[i]

print(he)
Problem p03072 (python)

Fixed submission:
N=int(input())
a=list(map(int,input().split()))
cnt=0
for i in range(N):
    if max(a[:i+1])==a[i]:
    	cnt+=1
print(cnt)

Buggy submission (verdict: Runtime Error):
N=int(input())
a=list(map(int,input().split()))
a=[a[i]-a[0] for i in a]
cnt=0
for i in range(len(a)):
    if a[i]>=0:
        cnt+=1
    a=[a[j]-a[i] for j in a]
print(cnt)

Buggy submission (verdict: Runtime Error):
N=int(input())
a=list(map(int,input().split()))
a=[a[i]-a[0] for i in a]
cnt=0
for i in range(len(a)):
    if a[i]>=0:
        cnt+=1
print(cnt)
Problem p03137 (python)

Fixed submission:
n,m=map(int,input().split())
a=sorted(list(map(int,input().split())))
b=[0]*(m-1)
for i in range(0,m-1):
  b[i]=a[i+1]-a[i]
c=sorted(b)
s=a[m-1]-a[0]
if m>n:
  for i in range(0,n-1):
  	s=s-c[m-i-2]
else:
  s=0
print(s)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=sorted(list(map(int,input().split())))
b=[0]*(m-1)
for i in range(0,m-1):
  b[i]=a[i+1]-a[i]
c=sorted(b)
s=a[m-1]-a[0]
for i in range(0,n-1):
  s=s-c[m-i-2]
print(s)
Problem p02723 (python)

Fixed submission:
S = str(input())
print('Yes' if S[2]==S[3] and S[4]==S[5] else 'No')

Buggy submission (verdict: Runtime Error):
S = str(input())
if(S[3]==S[4] and S[5]==S[6])
	print('Yes')
else
	print('No')
Problem p02754 (python)

Fixed submission:
n, a, b = map(int, input().split())
period = a+b
times = n//period
k = n%period
n =  a if k >a else k
print(times*a + n)

Buggy submission (verdict: Runtime Error):
#include<bits/stdc++.h>
using namespace std;
int main(){
    string S ;
    int Q;
    string query1,query;
    cin>>S;
    cin>>Q;
    for(int i = 1; i <= Q;i++){
        getline(cin, query1);
        query = query1;
        if(query[0]=='1'){
            reverse(S.begin(), S.end()); 
        }else{
            if(query[2]=='1'){
                S = query[4] + S;
            }else
            {
                S = S + query[4];
            }
            
        }
    }
    cout<<S<<endl;
	return 0;
}
Problem p02773 (python)

Fixed submission:
from collections import defaultdict
from collections import OrderedDict
N = int(input())
ans = dict()
for _ in range(N):
    k = str(input())
    if k in ans:
        ans[k]+=1
    else:
        ans.update({k:1})
groupedByValue = defaultdict(list)
for key, value in sorted(ans.items()):
    groupedByValue[value].append(key)
l = groupedByValue[max(groupedByValue)]
for i in l:
    print(i)

Buggy submission (verdict: Runtime Error):
from collections import OrderedDict
N = int(input())
ans = dict()
for _ in range(N):
    k = str(input())
    if k in ans:
        ans[k]+=1
    else:
        ans.update({k:1})
groupedByValue = defaultdict(list)
for key, value in sorted(ans.items()):
    groupedByValue[value].append(key)
l = groupedByValue[max(groupedByValue)]
for i in l:
    print(i)
Problem p02831 (python)

Fixed submission:
def gcd(a, b):
    return b if a == 0 else gcd(b%a, a)
num = [int(x) for x in input().split(" ")]
print(int(num[0]*num[1]/gcd(num[0], num[1])))

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
    return b 
  if a == 0 
  else gcd(b%a, a)
num = [int(x) for x in input().split(" ")]
print(int(num[0]*num[1]/gcd(num[0], num[1])))

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
    return b if a == 0 else gcd(b%a)
num = [int(x) for x in input().split(" ")]
print(int(num[0]*num[1]/gcd(num[0], num[1])))
Problem p02832 (python)

Fixed submission:
num, bricks, count, smash = int(input()), [int(x) for x in input().split(" ")], 1, 0
for x in bricks:
    if count == x: 
      count += 1
    else: 
      smash += 1
print(smash if smash != len(bricks) else 0 if len(bricks) == 1 else -1)

Buggy submission (verdict: Runtime Error):
num, 
bricks,
count, 
smash = int(input()), [int(x) for x in input().split(" ")], 1, 0
for x in bricks:
    if count == x: 
      count = 1
    else: 
      smash += 1
print(smash if smash != len(bricks) else 0 if len(bricks) == 1 else -1)
Problem p02835 (python)

Fixed submission:
a = [int(x) for x in input().split(" ")]
print("bust") if sum(a) >= 22 else print("win")

Buggy submission (verdict: Runtime Error):
a = [int(x) for x in input().split(" ")]
print("bust") if sum(a) >= 22 else print("win")
Problem p02723 (python)

Fixed submission:
a = input()
if a[2] == a[3] and a[4] == a[5]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import statistics
K,N = map(int,input().split())
A = [int(n) for n in input().split()]

a1 = max(A)-min(A)

for i in range(len(A)-1):
    max_v = 0
    index = None
    if (A[i+1]-A[i])>max_v:
        max_v = A[i+1]-A[i]
        index = i+1

a2 = A[index-1]+abs(K-A[index])
print(a1) if a1<a2 else print(a2)

Buggy submission (verdict: Runtime Error):
a = input()
if a[2] == a[3] && a[4] == a[5]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a = input()
print(a[2])
if a[2] == a[3] && a[4] == a[5]:
    print("Yes")
else:
    print("No")
Problem p02725 (python)

Fixed submission:
import statistics
K,N = map(int,input().split())
A = [int(n) for n in input().split()]

a1 = max(A)-min(A)

max_v = 0
A_i = None
for i in range(len(A)-1):
    if (A[i+1]-A[i])>max_v:
        max_v = A[i+1]-A[i]
        A_i = i+1

a2 = A[A_i-1]+abs(K-A[A_i])
print(a2) if a1>a2 else print(a1)

Buggy submission (verdict: Runtime Error):
import statistics
K,N = map(int,input().split())
A = [int(n) for n in input().split()]

a1 = max(A)-min(A)

max_v = 0
for i in range(len(A)-1):
    A_i = None
    if (A[i+1]-A[i])>max_v:
        max_v = A[i+1]-A[i]
        A_i = i+1

a2 = A[A_i-1]+abs(K-A[A_i])
print(a2) if a1>a2 else print(a1)

Buggy submission (verdict: Runtime Error):
import statistics
K,N = map(int,input().split())
A = [int(n) for n in input().split()]

a1 = max(A)-min(A)

for i in range(len(A)-1):
    max_v = 0
    index = None
    if (A[i+1]-A[i])>max_v:
        max_v = A[i+1]-A[i]
        index = i+1

a2 = A[index-1]+abs(K-A[index])
print(a2) if a1>a2 else print(a1)
Problem p02847 (python)

Fixed submission:
a = ["SUN","MON","TUE","WED","THU","FRI","SAT"][::-1]
S = input()
print(a.index(S)+1)

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

for i in reversed(range(len(str(A)))):
    num = int("1"+"0"*i)-1
    for N in reversed(range(num)):
        if X > A*N+B*i:
            print(A*N+B*i)
Problem p02754 (python)

Fixed submission:
n, a, b = map(int, input().split())

ans = n//(a+b)*a
ans += min(a, n%(a+b))

print(ans)

Buggy submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
ans = n//(a+b)*a
rem = n%(a+b)
if rem>=a:
    print(ans+a)
else 
    print(ans + rem)

Buggy submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
ball= ("b"*a+"r"*b)*(n//(a+b)+1)
print(ball[0:n].count("b"))
Problem p02777 (python)

Fixed submission:
s, t = input().split()
a, b = map(int, input().split())
u = input()

if s==u:
    a=a-1
else:
    b=b-1

print(a, b)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
p = list(int(i) for i in input().split())

kitai = list(map(lambda x: (x+1)/2, p))

gokei = 0

for i in range(n-k+1):
    wa = sum(kitai[i:i+k])
    if gokei < wa:
        gokei = wa

print(gokei)
Problem p02725 (python)

Fixed submission:
k, n = input().split()
a = input().split()
max = 0
for i in range(0,len(a)):
    if i==0:
        max = int(k)-int(a[len(a)-1])+int(a[0])
    d = int(a[i])-int(a[i-1])
    if d>max:
        max=d
print(int(k)-max)

Buggy submission (verdict: Runtime Error):
k, n = input().split()
a = input().split()
max = 0
for i in range(len(a)):
    if i==0:
        continue
    d = int(a[i])-int(a[i-1])
    if d>max:
        max=d
print(k-max)

Buggy submission (verdict: Runtime Error):
k, n = input().split()
a = input().split()
max = 0
for i in range(len(a)):
    if i==0:
        continue
    d = a[i]-a[i-1]
    if d>max:
        max=d
print(k-max)

Buggy submission (verdict: Runtime Error):
k, n = input().split()
a = input().split()
max = 0
for i in range(len(a)):
    d = a[i]-a[i-1]
    if d>max:
        max=d
print(k-max)
Problem p02723 (python)

Fixed submission:
a=list(input())
if(a[2]==a[3]) and (a[4]==a[5]):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a=list(input())
if(a[3]==a[4]) and (a[5]==a[6]):
  print('YES')
else:
  print('NO')
Problem p02729 (python)

Fixed submission:
import math


def nCr(n,r):
    if n<r:
        return 0
    
    result = math.factorial(n)//math.factorial(r)//math.factorial(n-r)
    return result

N,M = map(int,input().split())

total = nCr(N,2) + nCr(M,2)

print(total)

Buggy submission (verdict: Runtime Error):
import math


def nCr(n,r):
    result = math.factorial(n)//math.factorial(r)//math.factorial(n-r)
    return result

N,M = map(int,input().split())

total = nCr(N,2) + nCr(M,2)

print(total)
Problem p02753 (python)

Fixed submission:
s=input()
tmp=""
for i in s:
    if tmp != "":
        if tmp != i:
            print("Yes")
            exit()
    tmp = i
print("No")

Buggy submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
t=0
r=0
for _ in range(10^100):
    if n <= t:
        print(r)
        break
    elif n >= a+t:
        t+=a+b
        r+=a
    else:
        r+=min(n-t,a)
        t+=a+b
Problem p03803 (python)

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

int(a)
int(b)

if(a=='1'):
  a= 14

if(b=='1'):
  b= 14

if(int(a)-int(b)>0):
  print("Alice")
elif(int(a)-int(b)< 0):
  print("Bob")
else:
  print("Draw")

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

if(a==1):
  a= 14

if(b==1):
  b= 14

if(a-b>0):
  print("Alice")
elif(a-b< 0):
  print("Bob")
else:
  print("Draw")
Problem p02729 (python)

Fixed submission:
import math 

N2,M1 = map(int, input().split())
count=0
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

if N2!=0 and N2!=1:
    count += combinations_count(N2,2)
if M1!=0 and M1!=1:
    count += combinations_count(M1,2)

print(count)

Buggy submission (verdict: Runtime Error):
import math 

N2,M1 = map(int, input().split())
count=0
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

if N2!=0:
    count += combinations_count(N2,2)
if M1!=0:
    count += combinations_count(M1,2)

print(count)

Buggy submission (verdict: Runtime Error):
import math 

N2,M1 = map(int, input().split())

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


count = combinations_count(N2,2)

count += combinations_count(M1,2)

print(count)

Buggy submission (verdict: Runtime Error):
import math 

N2,M1 = map(int, input().split())

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

print(combinations_count(4, 2))

count = combinations_count(N2,2)

count += combinations_count(M1,2)

print(count)
Problem p02759 (python)

Fixed submission:
import math
print(math.ceil(int(input())/2))

Buggy submission (verdict: Runtime Error):
    N, M = list(map(int, input().split(' ')))
    r = [ None for i in range(N) ]
     
    illegal = False
    for i in range(M):
      s, c = list(map(int, input().split(' ')))
      if r[s-1] is not None and r[s-1] != c:
        illegal = True
        break
      r[s-1] = c
     
    v = -1
    if not illegal:
      for i in range(N):
        if r[i] is None:
          if i == 0 and N != 1:
            r[i] = 1
          else:
            r[i] = 0
      v = sum(r[i] * 10**i for i in range(N))
      if v < 10**(N-1) and not (N == 1 and v == 0):
        v = -1
     
    print(v)
Problem p02777 (python)

Fixed submission:
S, T = input().split()
s_i, t_i = map(int, input().split())
U = input()

if U == S:
    print(str(s_i - 1) + " " + str(t_i))
else:
    print(str(s_i) + " " + str(t_i - 1))

Buggy submission (verdict: Runtime Error):
S, T = input().split()
s_i, t_i = map(int, input().split())
U = input()

if U == S:
    print(str(s_i - 1) + " " + str(t_i))
else
    print(str(s_i) + " " + str(t_i - 1))
Problem p02970 (python)

Fixed submission:
N, D = input().split()
each = int(D)*2 + 1 
print(-(-int(N) // each))

Buggy submission (verdict: Runtime Error):
N, D = input().split()
each = D*2 + 1 
print(-(-N // each))
Problem p02723 (python)

Fixed submission:
S = str(input())
 
if S[2] == S[3] and S[4] == S[5]:
  print('Yes')
else:
  print('No')

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

if S[2] == s[3] and s[4] == s[5]:
  print('Yes')
Problem p02933 (python)

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

print(s if a >= 3200 else 'red' )

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

print(s if a >= 3200 else 'red' )
Problem p02951 (python)

Fixed submission:
a, b, c = [ int(x) for x in input().split() ]

if c-a+b > 0:
    print(c-a+b)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
# ABC 136 C
n = int(input())
h = [ int(_) for _ in input().split() ]
flag = True

for i in range(len(h)-1, 0, -1):
    if h[i-1] > h[i] +1:
        h[i-1] = h[i-1]-1  
        
for j in range(0,len(h)-1):
    if h[j] > h[j+1]:
        print('No')
        flag = False
        break
        
if flag == True:
    print('Yes')

Buggy submission (verdict: Runtime Error):
# ABC 136 C
n = int(input())
h = [ int(_) for _ in input().split() ]
flag = True

for i in range(len(h)-1, 0, -1):
    if h[i-1] > h[i] +1:
        h[i-1] = h[i-1]-1  
        
for j in range(0,len(h)-1):
    if h[j] > h[j+1]:
        print('No')
        flag = False
        break
        
if flag == True:
    print('Yes')

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

if n >= 100000:
    print(90909)
elif n >= 10000:
    print(n-9090)
elif n >= 1000:
    print(909)
elif n >= 100:
    print(n-90)
elif n >= 10:
    print(9)
else:
    print(n)

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

if n >= 100000:
    print(90909)
elif n >= 10000:
    print(n-9090)
elif n >= 1000:
    print(909)
elif n >= 100:
    print(n-90)
elif n >= 10:
    print(n)
Problem p02970 (python)

Fixed submission:
n, d = [ int(_) for _ in input().split() ]
x  = n / (2*d+1)

if x.is_integer():
    print( int(x//1) )
else:
    print( int( (x//1) + 1) )

Buggy submission (verdict: Runtime Error):
n, d = [ int(_) for _ in input().split() ]
x  = n / (2*d+1)
if x.is_integer()
    print( x )
else:
    print( x + 1 )
Problem p02897 (python)

Fixed submission:
N = int(input())

if N%2 == 0:
    print(N/2/N)

else:
    print(((N-1)/2 +1)/N)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = int(input())
a <= N

if a % 2 == 1:
    print(a/N)
Problem p02723 (python)

Fixed submission:
temp=input()
if temp[2]==temp[3] and temp[4]==temp[5]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
temp=input()
if temp[2]==temp[3]&&temp[4]==temp[5]:
  print("Yes")
else:
  print("No")
Problem p02723 (python)

Fixed submission:
# -*- coding: utf-8 -*-
text = list(input())
if text[2] == text[3]:
    if text[4]==text[5]:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
text = list(S)
if text[2] == text[3]:
    if text[4]==text[5]:
        print('Yes')
    else:
        prinrt('No')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
text = list(input())
if text[2] == text[3]:
    if text[4]==text[5]:
        print('Yes')
    else:
        prinrt('No')
else:
    print('No')