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

Fixed submission:
a = list(map(int,input().split()))
n,k = a
ans = 0
if n > k:
    ans = n % k
    if k - ans < ans:
        ans = k - ans
else:
    ans = k - n
    if ans > n:
        ans = n
print (ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
nn = N
K = int(input())
n = 1
st = []
m = min(N, K)
while N >= abs(nn - n * m) :
    N = abs(N - K)
    n = n + 1
print(min(m, N))

Buggy submission (verdict: Runtime Error):
N = int(input())
nn = N
K = int(input())
n = 1
st = []
m = min(N, K)
while N >= abs(nn - n * m) :
    N = abs(N - K)
    n = n + 1
    st.append(N)
    a = min(st)
print(min(m, a))
Problem p02742 (python)

Fixed submission:
import math
h,w = map(int,input().split())
if h==1 or w==1:
  print(1)
else:
  nos = math.ceil(w/2)*math.ceil(h/2) + math.floor(w/2)*math.floor(h/2)
  print(nos)

Buggy submission (verdict: Runtime Error):
r,c = int(input().split())
ans = r*c/2
if(r%2==0 and c%2==0):
    print(ans)
else
    print(ans+1)
Problem p02765 (python)

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

print (r if n >= 10 else r + 100 * (10 - n))

Buggy submission (verdict: Runtime Error):
N = int(input())
R = int(input())
if 0 <= R <= 4111:
    if 1<= N < 10:
        K = 100 * (10 - N)
        M = R + K
        print(M)
    if 10 <= N <= 100:
        print(R)
Problem p02778 (python)

Fixed submission:
s = input ()
# what stupid problem this is
print ('x' * len (s))

Buggy submission (verdict: Runtime Error):
c=str(input("please enter a string"))
list=list(c)
index=0
for x in list:
      list[index]='x'
      index+=1
s=''.join(list)
print(s)
Problem p02783 (python)

Fixed submission:
h, a = map(int, input().split())
print((h+a-1) // a)

Buggy submission (verdict: Runtime Error):
health = int(input())
decrease = int(input())
attack = 0
while health > 0:
    health = health - decrease
    attack += 1
print(attack)
Problem p02789 (python)

Fixed submission:
from sys import stdin

def main():
	N,M = map(int,stdin.readline().split())
	if(N == M):
		print("Yes")
	else:
		print("No")
main()

Buggy submission (verdict: Runtime Error):
N=int(input("enter 1st number:"))
M=int(input("enter 2nd number:"))
if N==M:
    print("Yes\n")
else:
    print("No\n")
Problem p02817 (python)

Fixed submission:

a, b = input().split()

print(b,end='')
print(a,end='')

Buggy submission (verdict: Runtime Error):
def stringcc(W,F):
    a = W
    b = F
    c = a+b
    return c

W,F= input().split()
a = stringcc(FW)
print(a)

Buggy submission (verdict: Runtime Error):
def stringconcant(S,T):
    x = S
    b = T
    c = x+b
    return c

S,T= input().split()
x = stringconcant(T,S)
print(a)
Problem p02844 (python)

Fixed submission:
import math
def split(word):
    return [int(char) for char in word]

input1 = int(input())
input2 = split(str(input()))
def indexEverything(input2):
    whereDict = dict()
    for index in range(len(input2)):
        try:
            whereDict[input2[index]].append(index)
        except:
            whereDict[input2[index]] = [index]
    return whereDict

def doesCodeExist(n, whereDict):
    ##n = int(n)
    ##print(n)
    ## n is a list of the three digits
    try:
        firstLoc = whereDict[int(n[0])][0]
    except:
        ##print("what")
        return False
    ##print(firstLoc)
    found2 = False
    counter2 = 0
    ##print("getting in here")
    while not found2:
        ##print("trying")
        try:
            ##print(whereDict[int(n[1])][counter2], firstLoc)
            ##print(whereDict[int(n[1])][counter2] > firstLoc)
            if (whereDict[int(n[1])][counter2] > firstLoc):
                secondLoc = whereDict[int(n[1])][counter2]
                ##print("beep")
                ##print(secondLoc)
                found2 = True
            ##print("jebtime")
            counter2 += 1

            #print(secondLoc)
        except:
            return False
    ##print(secondLoc)
    found3 = False
    counter3 = 0
    while not found3:
        try:
            if (whereDict[int(n[2])][counter3] > secondLoc):
                ##print(whereDict[int(n[2])][counter3])
                return True
            counter3 += 1
            ##print(counter3)
        except:
            return False

whereDict = indexEverything(input2)
counter = 0
##print("here")
##print(doesCodeExist("242", whereDict))
##print("fin")
for index in range(0, 1000):
    if (index < 100):
        if (index < 10):
            index = "00" + str(index)
        else:
            index = "0" + str(index)
    if (doesCodeExist(split(str(index)), whereDict)):
        ##print(index)
        counter += 1
print(counter)

Buggy submission (verdict: Runtime Error):
def f(s,l=3):
  if l==1:
    return len(set(s))
  a=0
  for i in set(s):
    a+=f(s[s.index(i)+1:],l-1)
  return a

n=int(input())
s=input()
print(f(s)i)

Buggy submission (verdict: Runtime Error):
int(input())
n=input()
answer=0
for i in range(10):
    if str(i) in n:
        T=n[n.index(str(i))+1:]
        for j in range(10):
            if str(j) in T:
                U=T[T.index(str(j))+1:]
                for k in range(10):
                    if str(k) in U:
                        ans+=1
print(answer)
Problem p02854 (python)

Fixed submission:
N=input()
b=input().split()
sum=0
bigsum=0
for i in b:
    sum+=eval(i)
standard=sum/2
for i in b:
    bigsum+=eval(i)
    if bigsum>standard:
        smallsum=bigsum-eval(i)
        break
if bigsum-standard>standard-smallsum:
    print(sum-2*smallsum)
else:
    print(2*bigsum-sum)

Buggy submission (verdict: Runtime Error):
n=int(input())
arr = map(int,input().split())
k=0
if n%2==1:
	k1=0
	k2=0
	for i in range(n//2):
		k1=k1+arr[i]-arr[n-i-1]
	print(abs(abs(k1)-arr[n//2]))
else:
	for i in range(n//2):
		k=k+arr[i]-arr[n-1-i]
	print(abs(k))
Problem p02887 (python)

Fixed submission:
length = input()
string = input()

color = 1
prev = string[0]
modified = string[0]


for c in string :
    if c == prev :
        continue
    else :
        prev = c
        color = color + 1
        modified = modified + c

print(color)

Buggy submission (verdict: Runtime Error):
def main(n,s):
    if n == 1:
        return 1
        
    count = 1
    for i in range(1,n):
        if s[i] != s[i-1]:
            print(s[i] + s[i-1])
            count += 1
    return count

inp = input().split("\n")
n = int(inp[0])
s = inp[1]


print(main(n,s))

Buggy submission (verdict: Runtime Error):
def main(n,s):
    if n == 1:
        return 1
        
    count = 1
    for i in range(1,n):
        if s[i] != s[i-1]:
            count += 1
    return count

inp = input().split("\n")
n = int(inp[0])
s = inp[1]


print(main(n,s))
Problem p02903 (python)

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

arow = '1'*A + '0'*(W-A)
brow = '0'*A + '1'*(W-A)

for i in range(1,H+1):
    if (i <= B):
        print(brow)
    else:
        print(arow)

Buggy submission (verdict: Runtime Error):
h,w,a,b=map(int,input().split())
m=[[0]]
for i in range(w-1):
  s=min(m[0],key=lambda x:m[0].count(x))
  x=m[0].count(1-s)
  m[0]+=[1-s if x<a else s]
for i in range(h-1):
  n=[*zip(*m)]
  s=min(n[0],key=lambda x:n[0].count(x))
  x=n[0].count(1-s)
  m+=[[1-i for i in m[0]] if x<b else m[0]]

for i in m:
  print(*i)
Problem p02922 (python)

Fixed submission:
input1 = input()
x = []
y=[]
check=0

for i in input1:
    if i!=" " and check==0:
        x.append(i)
    elif i==" ":
        check=1
    elif i!=" " and check==1:
        check==1
        y.append(i)
xstring=''.join(x)
ystring=''.join(y)

xint=int(xstring)
yint=int(ystring)

if yint==1:
    print(0)
else:
    cnt=0
    while ((xint-1)*(cnt))+xint<yint:
        cnt=cnt+1
    cnt=cnt+1
    print(cnt)

Buggy submission (verdict: Runtime Error):
def calulate(m, n) : 
	n_adapters = 0
	if n <= m :
		n_adapters = 1
	else :
		n_adapters = n//m
		if n % m != 0:
			n_adapters += 1
	return n_adapters

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

calculate(M, N)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
socket = 0
count = 0
while socket < B :
    if socket + A < B :
        socket = socket + A - 1
        count += 1
    elif socket+A >= B :
        socket = socket + A
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
socket = A - 1
count=1
while (socket) < B :
    if (socket+A) < B :
        socket = socket + A - 1
        count+=1
    elif (socket+A) >= B :
        socket=socket+A
        count+=1
print(count)

Buggy submission (verdict: Runtime Error):
import math
S = input()
A = int(S[0])
B = int(S[1:])
n = math.ceil(B/A)
print(n, " power strips, each with", A , "sockets, extend the socket into", A*n, "empty sockets.")
Problem p02923 (python)

Fixed submission:
n = int(input())
values = [float(s) for s in input().split(" ")]

start = 0
ans = 0

for i in range(1,n):
    if values[i] > values[i-1]:
        start = i
    ans = max(ans,i-start)
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
ar=[]
c=0
m=0
cur=0
for i in range(0,n):
    ar.append(int(input()))
for i in range(0,n):
    cur=i
    for j in range(i+1,n):
        if(cur+1<n and ar[cur]>=ar[cur+1]):
            c+=1
            cur+=1
        else:
            break
    if(m<c):
        m=c
    c=0


print(m)

Buggy submission (verdict: Runtime Error):
N = int(input())
prev_num = -1
curr_num = int(input())

max_count = 0
max_ind = -1

curr_count = 0
curr_ind = 0

for itr in range (1,N):
    prev_num = curr_num
    curr_num = int(input())

    if(prev_num >= curr_num):
        curr_count += 1
    else:
        if(max_count<curr_count):
            max_ind = curr_ind
            max_count = curr_count

        curr_ind = itr
        curr_count = 0

if(max_count<curr_count):
    max_count = curr_count
print (max_count)

Buggy submission (verdict: Runtime Error):
n=input()
a=[]
m=[]

for i in range(int(n)):
    a.append(input())
for i in range(int(n)):
    c=0
    for j in range(i,int(n),1):
        if(a[i]>a[j]):
            c+=1
        else:
            break
    m.append(c)

print(max(m))

Buggy submission (verdict: Runtime Error):
n=int(input().strip(EOF))
h=list(map(int,input().split()))
count=flag=0 
for i in range(n-1): 
      if(h[i]>=h[i+1]):
        flag+=1
      else :
        count=flag if(flag>count) else count
        flag=0
print(count)

Buggy submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
count=flag=0 
for i in range(n): 
      if(h[i]>=h[i+1]):
        flag+=1
      else :
        count=flag if(flag>count) else count
        flag=0
print(count)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=[]
for i in range(n):
    s.append(int(input()))
cho=int(input())
c=0
for i in range(cho-1,n-1):
    if(s[i]>s[i+1]):
        c+=1
    else:
        break
print(c)
Problem p02924 (python)

Fixed submission:
n=int(input())
n-=1
print(n*(n+1)//2)
##############################################################################################################################################################################################################################

Buggy submission (verdict: Runtime Error):
#include <iostream>

using namespace std;

int main()
{
    long long n;
    scanf("%lld",&n);
    printf("%lld\n",n*(n-1)/2);
    return 0;
}
Problem p02995 (python)

Fixed submission:
def nod(a, b):
    if a == 0:
        return b
    elif a > b:
        return nod(a % b, b)
    return nod(b % a, a)


a, b, c, d = map(int, input().split())
ac = a + (c - a % c) % c
ad = a + (d - a % d) % d
bc = b - b % c
bd = b - b % d
dc = c*d//nod(c,d)
acd=a + (dc - a % dc) % dc
bcd = b - b % dc
print(b-a+1-(max(0,(bc-ac)//c+1)+max(0,(bd-ad)//d+1)-max(0,(bcd-acd)//dc+1)))

Buggy submission (verdict: Runtime Error):
from math import gcd


def find(n, k):

    if n == 0:
        return 0
    
    return n // k

def interval(l, r, k):
    return find(r, k) - find(l - 1, k)

a, b, c, d = map(int, input().split())

print((b - a + 1) - interval(a, b, c) - interval(a, b, d) + interval(a, b, (c * d) // gcd(c, d)))
Problem p03001 (python)

Fixed submission:
w,h,x,y= map(int,input().split())
print(w*h/2,int(x==w/2 and y == h/2))

Buggy submission (verdict: Runtime Error):
coordinates = list(map(int, input().split()))
w = coordinates[0]
h = coordinates[1]
x = coordinates[2]
y = coordinates[3]
prod1 = x * h
prod2 = y * w
area = min(prod1, prod2)
if x == w and y == h:
    area = area / 2
area = format(area, '.6f')
if x == w and y == h:
    area = area - 0.000001
addit = 0 if prod1 != prod2  else 1
print("{} {}".format(area, addit))

Buggy submission (verdict: Runtime Error):
coordinates = list(map(int, input().rstrip().split()))
w = coordinates[0]
h = coordinates[1]
x = coordinates[2]
y = coordinates[3]
prod1 = x * h
prod2 = y * w
if x == w and y == h:
    prod1 = prod2 = (w * h) / 2
area = min(prod1, prod2)
area = format(area, '.6f')
addit = 0 if prod1 != prod2 else 1
print(f"{area} {addit}")
Problem p03071 (python)

Fixed submission:
n, m=[int(k) for k in input().split()]
cont=0
for i in range(2):
    if n>m: 
        cont+=n
        n-=1
    elif m>=n:
        cont+=m
        m-=1
print(cont)

Buggy submission (verdict: Runtime Error):
s = 0
for i in range(2):
    if A > B:
        s += A
        A -= 1
    elif B > A:
        s += B
        B -= 1
    elif A == B:
        s += A
        A -= 1
print(s)

Buggy submission (verdict: Runtime Error):
s = 0
for i in range(2):
    if A > B:
        s += A
        A -= 1
    elif B > A:
        s += B
        B -= 1
    elif A == B:
        s += A
        A -= 1
print(s)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
if A == B:
    print(2*A)
else:
    print(2*max(A,B)-1)

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

if 2*a-1 > 2*b-1:
    if (2*a-1) > a+b:
        print(2*a-1)
    else:
        print(a+b)
else:
    if 2*b-1 > a+b:
        print(2*b-1)
    else:
        print(a+b)
Problem p03145 (python)

Fixed submission:
ab, bc, ca = map(int, input().split())

area = int((ab*bc)/2)

print(area)

Buggy submission (verdict: Runtime Error):
num = [int(n) for n in line.split()]
sides = [num_a, num_b, num_c]
sides.sort()
area = round(sides[0] * sides[1])/2
print(area)
Problem p03160 (python)

Fixed submission:
n = int(input())
h = [int(x) for x in input().split()]

def abs(x):
    if x >= 0:
        return x
    return -x

c = [0]
c.append(abs(h[1] - h[0]))
for k in range(2, n):
    cnext = min(c[k-2] + abs(h[k]-h[k-2]), c[k-1] + abs(h[k] - h[k-1]))
    c.append(cnext)

print(c[-1])

Buggy submission (verdict: Runtime Error):

def main():
    global n, peso, dp

    n = int(input())
    peso = [int(x) for x in input().split()]
    dp = [-1]*n
    
    peso.append(10**9)
    
    print(frog(0))
    
def frog(i):
    global n, peso, dp
    
    if i >= n - 1:
        return 0

    if dp[i] != -1:
        return dp[i]

    dp[i] = min(abs(peso[i + 1] - peso[i]) + frog(i + 1),
            abs(peso[i + 2] - peso[i]) + frog(i + 2))
    
    return dp[i]

main()

Buggy submission (verdict: Runtime Error):
from functools import lru_cache
import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__
# do magic here
n = int(input())
heights = [int(x) for x in input().split()]

MAX = 10000000

@lru_cache(MAX)
def solve(x):
    if x==0:
        return 0
    if x < 0:
        return MAX
    a = abs(heights[x-1] - heights[x]) + solve(x-1)
    b = abs(heights[x-2] - heights[x]) + solve(x-2)
    return min(a,b)

print(solve(n-1))

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
h = list(map(int, input().split()))

mincost = [math.inf for _ in range(N)]
mincost[0] = 0
mincost[1] = abs(h[1] - h[0])

for i in range(2, N):
    mincost[i] = min(mincost[i - 2] + abs(h[i] - h[i - 2]), mincost[i - 1] + abs(h[i] - h[i - 1]))

print(mincost[N - 1])

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
h = input().split()
h = [int(i) for i in h]

aux = [math.inf for i in range(n)] 
aux[0] = 0
aux[1] = abs(h[1] - h[0])

for i in range(2,n):
    aux[i] = min(aux[i - 2] + abs(h[i] - h[i - 2]), aux[i - 1] + abs(h[i] - h[i - 1]))

print(aux[n-1])
Problem p03161 (python)

Fixed submission:
def main():
    infinity = 1e10

    n, k, height = getInputs()

    cost = [infinity] * n
    cost[0] = 0
    cost[1] = abs(height[0] - height[1])

    for i in range(2, n):
        for j in range(i - 1, i - k - 1, -1):
            if j >= 0:
                cost[i] = min(cost[i], cost[j] + abs(height[i] - height[j]))

    print(cost[-1])

def getInputs():
    n, k = map(lambda x: int(x), input().split())
    height = tuple(map(lambda x: int(x), input().split()))

    return n, k, height

main()

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
*H, = map(int, input().split())
 
Cost = N*[float("inf")]
Cost[0] = 0
 
for i in range(1, N):
    if i == 1:
        Cost[1] = Cost[0] + abs(H[0]-H[1])
        continue
 
    Cost[i] = min([Cost[i-u] + abs(h[i-u]-h[i]) for u in range(1, K+1)])
 
print(Cost[N-1])
Problem p03163 (python)

Fixed submission:
def main():
    n, w = tuple([int(e) for e in input().split()])
    items = []
    for i in range(n):
        items.append(tuple([int(e) for e in input().split()]))
    items.sort(key=lambda x: x[0])
    
    t = [[0] * (n + 1) for _ in range(w + 1)]
    for i in range(1, w + 1):
        for j in range(1, n + 1):
            if i - items[j - 1][0] >= 0:
                t[i][j] = t[i - items[j - 1][0]][j - 1] + items[j - 1][1]
            t[i][j] = max(t[i][j], t[i][j - 1], t[i - 1][j], t[i - 1][j - 1])
    print(t[w][n])
    return 0

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
arr=[]
n,w=map(int,input().split())
for _ in range(n):
	arr.append(tuple(map(int,input().split())))
dp=[-1]*((n+1)*(w+1))
def f(pos,W):
	if(pos==n):
		return 0
	if dp[pos*(w+1)+W]!=-1:
		return dp[pos*(w+1)+W]
	res=f(pos+1,W)
	if(arr[pos][0]<=W):
		res=max(res,f(pos+1,W-arr[pos][0])+arr[pos][1])
	dp[pos*(w+1)+W]=res
	return res
print(f(0,w))
Problem p03239 (python)

Fixed submission:
def LimitedTime(Array , T , N):
    MinC=1001
    for i in range (N):
            if Array[i][1]<=T:
               if Array[i][0]<MinC:
                   MinC=Array[i][0]
    if MinC==1001:
        return 'TLE'
    else:
        return MinC
                
                
                   
                   



TandN=list(map(int ,input().split()))
N=TandN[0]
T=TandN[1]
Array=[[int(j) for j in input().split()]for i in range(N)]
print(LimitedTime(Array , T ,N))

Buggy submission (verdict: Runtime Error):
n, T = map(int, input().split())
out = list()
for _ in range(n):
    c, t = map(int, input().split())
    if t > T: continue
    out.append((c, t))
print(min(out)[0]) if min(out)[0] < T else print("TLE")

Buggy submission (verdict: Runtime Error):
a,b = (input().split())
a = int(a)
b = int(b)
roads = []
for i in range(a) :
   c , t = input().split()
    t = int(t)
    if t in range (1, b + 1):
        roads.append((int(c) ,t))
 
if len(roads) == 0 :
    print ("TLE")
else:
    roads.sort()
    print (roads[0][0])

Buggy submission (verdict: Runtime Error):
N , T = map(int, input().split())
mini = T
for i in range(N):
    c , t = input().split()
for i in  range(N-1):
    if int(t[i])<mini:
        mini = int(t[i])
if mini<T:
    print(c[i])
else:
    print("TLE")
Problem p03251 (python)

Fixed submission:
n,m,a,b = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
x = max(x)
y = min(y)
for z in range(x+1,y+1):
    if a < z and z <= b:
        print("No War")
        quit()
print("War")

Buggy submission (verdict: Runtime Error):
def main():

    inp1 = input().split()
    inp2 = input().split()
    inp3 = input().split()

    if(int(inp1[2]) >= int(inp1[3])):
        return "War"

    maximum = int(inp2[0])

    for i in range(int(inp1[0])):
        if maximum < int(inp2[i]):
            maximum = int(inp2[i])

    minimum = int(inp3[0])

    for i in range(int(inp1[1])):
        if minimum > int(inp3[i]):
            minimum = int(inp3[i])

    if(minimum <= maximum):
        return "War"

    return "No War"

print(main())

Buggy submission (verdict: Runtime Error):
N, M, X, Y = map(int, input().split())
a = list(map(int, input().split()))
for i in range(M):
    if(i == 0):
        mx= a[i]
    else:
        mx = max(a[i],mx)
a = list(map(int, input().split()))
if(mx >= Y):
    print("War")
    quit()
for i in range(M):
    if(i == 0):
        my = a[i]
    else:
        my = min(a[i],my)
if(my <= X):
    print("War")
    quit()
if(mx >= my):
    print("War")
else:
    print("No War")
Problem p03261 (python)

Fixed submission:
n= int(input())
w=[]
w.append(input())
c=0
for i in range(n-1):
    s=input()
    if s not in w and w[i][len(w[i])-1] == s[0]:
        c+=1
        w.append(s)
    else:
        break
 
 
if c==n-1:
    print("Yes")
else:
    print ("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
word = list(str(input()) for _ in range(N))
res = 'Yes'
if len(word) != len(set(word)):
    print('No')
    exit()
last = (word[0])[0]
for i, x in enumerate(word):
    if last != x[0]:
        print('No')
        exit()
    last = x[-1]
print('Yes'
Problem p03264 (python)

Fixed submission:
k = int(input())
x = [i for i in range(1, k+1) if i & 1 == 0]
y = [i for i in range(1, k+1) if i & 1 == 1]
print(len(x)*len(y))

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

def main():
    line=stdin.readline()
    parts=line.split()
    a=int(parts[0])
    par=int(a/2)
    impar=int(a/2)+a%2
    stdout.write(par*impar)
main()

Buggy submission (verdict: Runtime Error):
N=int(input("enter number")) 
even=0
odd=0
if N%2==0:
    even=N/2
    odd=N/2
elif N=0:
    even=1
    odd=1
else:
    even=N//2
    odd=(N//2) +1
Print(even*odd)
Comment in Mark

Buggy submission (verdict: Runtime Error):
n:int  = input()
s:int = 0
for i in range(0, int(n), 1):
    for j in range(0,int(i),2):
        s = s + 1
print(s)

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

y=x//2

if (y%2==0):
    print (y**2)
elif print ((y**2)+1)

Buggy submission (verdict: Runtime Error):
k=input()  
odd=1
even=0
for i in range(2,k+1) 
     if i%2==0:
        even+=1
     else:
           odd+=1
print(odd*even)

Buggy submission (verdict: Runtime Error):
k=input()
pair=0
for i in range(1,k+1):
     for j in range (2,k+1)
          if i%2==0 and j%2!=0:
              pair+=1
         ELIF i%2!=0 and j%2==0 :
               pair+=1
          else:
                pass
print(pair)
Problem p03337 (python)

Fixed submission:
a,b = map(int,input().split())
print(max([a+b,a-b,a*b]))

Buggy submission (verdict: Runtime Error):
line = input()
num_a, num_b = [int(n) for n in line.split()][0]
print(max([num_a + num_b, num_a - num_b, num_a * num_b]))

Buggy submission (verdict: Runtime Error):
line = input()
A,B = [int(u) for u in line]
def func(a,b)
    return min(a+b,a-b,a*b)
print(func(A,B))

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

c = a + b
d = a - b
e = a * b
ary = [c, d, e]
f = max(ary)
print ("Max:", f)
Problem p03360 (python)

Fixed submission:
num = input()
A = int(num.split(' ')[0])
B = int(num.split(' ')[1])
C = int(num.split(' ')[2])
K = int(input())
num = [A,B,C]
while K>0:

    posi = num.index(max(num))
    num[posi]=num[posi]*2

    K=K-1

print(sum(num))

Buggy submission (verdict: Runtime Error):
line = input()
num_a, num_b, num_c, num_k = [int(n) for n in line.split()][0]
numbers = [num_a, num_b, num_c]
numbers.sort(reverse=True)
numbers[0] *= 2**num_k
print(sum(numbers))
Problem p03377 (python)

Fixed submission:
num = input()
a = int(num.split(' ')[0])
b = int(num.split(' ')[1])
x = int(num.split(' ')[2])


if a+b>=x:
    if a>x:
        print("NO")
    else:
        print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
package main

import (
	"fmt"
)

func main(){
	var A, B int
	fmt.Scan(&A)
	fmt.Scan(&B)
	if A+B > 16 {
		panic("Exceeded pieces!")
	}
	if A > 8 || B > 8 {
		fmt.Println(":(")
	} else {
		fmt.Println("Yay!")
	}
}

Buggy submission (verdict: Runtime Error):
#include <stdio.h>
int main (){
int gatos, animais, X;
scanf("%d%d%d", &gatos,&animais,&X);
if (X >= gatos && animais + gatos >= X)
    printf("YES");
else
	printf("NO");

	return 0;
}