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

Fixed submission:
x,y=(int(x) for x in input().split())
prize=0
if x==1:
  prize+=300000
if x==2:
  prize+=200000
if x==3:
  prize+=100000
if y==1:
  prize+=300000
if y==2:
  prize+=200000
if y==3:
  prize+=100000
if x==1 and y==1:
  prize+=400000
print(prize)

Buggy submission (verdict: Runtime Error):
x=int(input())
y=int(input())
prize=0
if x==1:
  prize+=300000
if x==2:
  prize+=200000
if x==3:
  prize+=100000
if y==1:
  prize+=300000
if y==2:
  prize+=200000
if y==3:
  prize+=100000
if x==1 and y==1:
  prize+=400000
print(prize)
Problem p02841 (python)

Fixed submission:
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())

if (m1!=m2):
    print(1)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())

if (m1/=m2):
  print(1)
else:
  print(0)
Problem p02993 (python)

Fixed submission:
n = input()
print(["Good" if n[0] != n[1] != n[2] != n[3] else "Bad"][0])

Buggy submission (verdict: Runtime Error):
N, L = map(int, input().split())
flavors = [x + L - 1 for x in range(1, N + 1)]
flavors.remove(min(flavors, key=abs))
print(sum(flavors))
Problem p02994 (python)

Fixed submission:
N, L = map(int, input().split())
flavors = [x + L - 1 for x in range(1, N + 1)]
flavors.remove(min(flavors, key=abs))
# flavors.pop(flavors.index(min(flavors, key=abs)))
print(sum(flavors))

Buggy submission (verdict: Runtime Error):
N, L = int(input()), int(input())

flavors = [x + L - 1 for x in range(1, N + 1)]
planned_pie = sum(flavors)
eat = min(flavors)
eat_abs = -min([abs(x) for x in flavors])
print([planned_pie - max(eat, eat_abs) if planned_pie <
       0 else planned_pie - max(eat, eat_abs)][0])
Problem p03162 (python)

Fixed submission:
import copy

def main():
	n = int(input())
	a = []
	for _ in range(0, n):
		x = [int(x) for x in input().split()]
		a.append(x)
	
	cur = a[0]
	nxt = [0] * 3

	for i in range(1, len(a)):
		nxt[0] = max(a[i][0] + cur[1], a[i][0] + cur[2])
		nxt[1] = max(a[i][1] + cur[0], a[i][1] + cur[2])
		nxt[2] = max(a[i][2] + cur[1], a[i][2] + cur[0])

		cur = copy.deepcopy(nxt)

	print(max(cur[0], cur[1], cur[2]))

if __name__ == "__main__":
	main()

Buggy submission (verdict: Runtime Error):
import copy

class Item:
	def __init__(self):
		self.weight = 0
		self.value = 0

	def __repr__(self):
		return "(" + str(self.weight) + ", " + str(self.value) + ")"

items = []


def main():
	N, W = [int(x) for x in input().split()]
	global items
	
	for _ in range(0, N):
		x = Item()
		x.weight, x.value = [int(y) for y in input().split()]
		items.append(x)


	dp = [[]] * (N + 1)
	for _ in range(0, N + 1):
		dp[_] = [0] * (W + 1)
	

	dp[0][0] = 0
	for i in range(1, N + 1):
		for j in range(0, W + 1):
			if items[i - 1].weight > j:
				dp[i][j] = dp[i - 1][j]
			else:
				dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - items[i - 1].weight] + items[i - 1].value)

	print(dp[N][W])

if __name__ == "__main__":
	main()
Problem p02823 (python)

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

if (b - a) % 2 == 0:
    print((b - a) // 2)
else:
    print(min(a, n - b + 1) + (b - a - 1) // 2)

Buggy submission (verdict: Runtime Error):
n,a,b=map(int,input().split())if(b-a)%2==0:print((b-a)//2)else:print(min(a-1,n-b)+1+(b-a-1)//2)

Buggy submission (verdict: Runtime Error):

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

if (b - a)% == 0:
    print((b - a)//2)
else:
    print(min(a - 1, n - b) + 1 +(b - a - 1)//2)
Problem p03434 (python)

Fixed submission:
num = []
A = 0
B = 0
count = int(input())
list = input().split()
for i in range(count):
    num.append(int(list[i]))
num = sorted(num, reverse = True)

while num != []:
    A += num.pop(0)
    if num != []:
        B += num.pop(0)

print(A - B)

Buggy submission (verdict: Runtime Error):
num = []
A = 0
B = 0
for i in range(int(input())):
    num.append(int(input()))
num = sorted(num)
while num != []:
    A += pop(num[0])
    if num != []:
        B += pop(num[0])

print(A - B)
Problem p03494 (python)

Fixed submission:

a = input()
b = input()
count = int(a)
num = []

for k in range(count):
    num.append(int(b.split()[k]))

result = 0
division = True
while division:
    div = 0
    for i in range(count):
        if num[i]%2 == 0:
            div += 1
    if div == count:
        for j in range(count):
            num.append(num.pop(0)/2)
        result += 1
    else:
        division = False

print(result)

Buggy submission (verdict: Runtime Error):

a = input()
b = input()
count = int(a)

num = map(int, b.split())
division = True
result = 0
while division:
    div = 0
    for i in range(count):
        if num[i]%2 == 0:
            div += 1
    if div == count:
        for j in range(count):
            num.append(num.pop(0)/2)
        result += 1
    else:
        division = False

print(result)

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

num = map(int, b.split())
division = True
result = 0
while division:
    div = 0
    for i in range(count):
        if num[i]%2 == 0:
            div += 1
    if div == count:
        for j in range(count):
            num.append(num.pop(0)/2)
        result += 1
    else:
        division = False

print(result)

Buggy submission (verdict: Runtime Error):

a = input()
b =　input()

count = int(a)

num = map(int, b.split())
division = True
result = 0
while division:
    div = 0
    for i in range(count):
        if num[i]%2 == 0:
            div += 1
    if div == count:
        for j in range(count):
            num.append(num.pop(0)/2)
        result += 1
    else:
        division = False

print(result)

Buggy submission (verdict: Runtime Error):

a = input()
b = input()

count = int(a)

num = map(int, b.split())
division = True
result = 0
while division:
    div = 0
    for i in range(count):
        if num[i]%2 == 0:
            div += 1
    if div == 3:
        for j in range(count):
            num.append(num.pop(0)/2)
        result += 1
    else:
        division = False

print(result)
Problem p03624 (python)

Fixed submission:
word = input()
al = "qwertyuiopasdfghjklzxcvbnm"
d = []
for i in range(len(al)):
    if not al[i] in word:
        d.append(al[i])
if d == []:
    print("None")
else:
    print(sorted(d)[0])

Buggy submission (verdict: Runtime Error):
word = input()
al = [chr(ord("a") + i) for i in range(26)]
ans = "None"
for i in range(len(al)):
    if not al[i] in word:
      ans = append(al[i])
      break
print(ans)
Problem p03658 (python)

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

num = sorted(list(map(int, input().split())), reverse = True)

print(sum(num[:k]))

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

print(sum(sorted(list(map(input(split()))), reverse = True)[0:k+1]))
Problem p03061 (python)

Fixed submission:
def gcd(a,b):
	while b:
		a,b=b,a%b
	return a
n=int(input())
l = list(map(int, input().split()))
ans=1;
m=[0]*(n+1)
o=[0]*(n+1)
for i in range(n):
	m[i+1]=gcd(m[i],l[i])
	o[i+1]=gcd(o[i],l[n-i-1])
for i in range(n):
	ans=max(gcd(m[i],o[n-i-1]),ans)
print(ans)

Buggy submission (verdict: Runtime Error):
import math
n=int(input())
l = list(map(int, input().split()))
ans=1;
for i in range(n):
	ans=max(math.gcd(math.gcd(l[0],l[i-1]),math.gcd(l[i],l[n-1])),ans)
print(ans)
Problem p02823 (python)

Fixed submission:
N, A, B = [int(i) for i in input().split()]
ans = []
if (B-A)%2 == 0:
    print(int((B-A)//2))
else:
    print(int((B-A)//2+1+min([A-1,N-B])))

Buggy submission (verdict: Runtime Error):
N, A, B = [int(i) for i in input().split()]
ans = []
if (B-A)%2 == 0:
print(int(int(B-A)/2))
else:
print(int((B-A)//2+1+min([A-1,N-B])))

Buggy submission (verdict: Runtime Error):
    N, A, B = [int(i) for i in input().split()]
    ans = []
    if (B-A)%2 == 0:
        print(int(int(B-A)/2))
    else:
        print(int((B-A)//2+1+min([A-1,N-B])))

Buggy submission (verdict: Runtime Error):
    N, A, B = [int(i) for i in input().split()]
    ans = []
    if (B-A)%2 == 0:
        print(int((B-A)/2))
    else:
        print(int((B-A)//2+1+min([A-1,N-B])))
Problem p02946 (python)

Fixed submission:
K,X = map(int, input().split(" "))
x_min = X-K+1
x_max = X+K-1
r = [str(i) for i in range(x_min,x_max+1)]
print(" ".join(r))

Buggy submission (verdict: Runtime Error):
K,X = map(int, input().split(" "))
x_min = X-K+1
x_max = X+K-1
r = [i for i in range(x_min,x_max+1)]
print(" ".join(r))

Buggy submission (verdict: Runtime Error):
K,X = map(int, input().split(" "))
x_min = X-K+1
x_max = X+k-1
r = [i for i in range(x_min,x_max+1)]
print(" ".join(r))
Problem p02969 (python)

Fixed submission:
a=int(input())
print(3*(a*a))

Buggy submission (verdict: Runtime Error):
a=int(input)
def area(int x):
  area=3*(x^2)
  return area
x=area(a)
print (x)
Problem p02899 (python)

Fixed submission:
import numpy as np

n = int(input())
a = [int(x) for x in input().split()]
np_a = np.array(a)

a_idx = np.argsort(np_a)
#print(a_idx)

res = [str(1+int(x)) for x in a_idx.tolist()]
#print(res)

print(' '.join(res))

Buggy submission (verdict: Runtime Error):
import numpy as np

n = int(input())
a = [int(x) for x in input().split()]
np_a = np.array(a)

a_idx = np.argsort(np_a)
#print(a_idx)

res = [str(1+int(x)) for x in a_idx.tolist()]
#print(res)

print(' '.join(res))
Problem p02900 (python)

Fixed submission:

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append(i)

    if temp!=1:
        arr.append(temp)

    if arr==[]:
        arr.append(n)

    return arr

#import numpy as np

a, b = map(int, input().split())
if a==1 and b==1:
    print(1)
else:
    #print(factorization(a))
    prime_a = factorization(a)
    prime_b = factorization(b)
    #print(prime_a, prime_b)
    print(1+len(set(prime_a)&set(prime_b)))

Buggy submission (verdict: Runtime Error):

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append(i)

    if temp!=1:
        arr.append(temp)

    if arr==[]:
        arr.append(n)

    return arr

#import numpy as np

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

#print(factorization(a))
prime_a = factorization(a).append(1)
prime_b = factorization(b).append(1)
#print(prime_a, prime_b)
print(1+len(set(prime_a)&set(prime_b)))
Problem p02921 (python)

Fixed submission:
t = list(input())
s = list(input())
cnt = 0
for a in range(3):
    if s[a] == t[a]:
        cnt = cnt + 1

print(cnt)

Buggy submission (verdict: Runtime Error):
### INPUT
N = int(input())
A = list(map(int,input().split()))
cont = 0
CN = [0]
b = N-1
### MAIN
for i in range(b):
    s = i
    while A[s]>=A[s+1] and s+1!=b:
        cont = cont + 1
        s = 1 + s
    if  (A[s]>=A[s+1]) and (s+1==b):
        cont =cont + 1
    if  cont != 0:
        CN.extend([cont])
        cont = 0
### MAX

print(max(CN))

Buggy submission (verdict: Runtime Error):
### INPUT
N = int(input())
A = list(map(int,input().split()))
A.extend([1000])
cont = 0
CN = [0]
b = N-1
### MAIN
for i in range(b):
    s = i
    while (A[s]>A[s+1]) and ((s+1)!=(b+1)):
        cont = cont + 1
        s = 1 + s
    if  cont != 0:
        CN.extend([cont])
        cont = 0
### MAX
print(max(CN))
Problem p02923 (python)

Fixed submission:
### INPUT
N = int(input())
A = list(map(int,input().split()))
cont = 0
b = N-1
MAX = 0
### MAIN
for i in range(b):
    if A[i]>=A[i+1] :
        cont = cont + 1
    else:
        cont = 0

    if cont > MAX:
        MAX = cont
### OUT
print(MAX)

Buggy submission (verdict: Runtime Error):
### INPUT
N = int(input())
A = list(map(int,input().split()))
cont = 0
CN = [0]
### MAIN
for i in range(N-1):
    s = i
    while A[s]>A[s+1]:
        cont = cont + 1
        s = 1 + s
    if  cont != 0:
        CN.extend([cont])
        cont = 0
### MAX
print(max(CN))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input().split()
s_i = [int(d) for d in s]
cnt = [0]
cn = 0
r = 1
d = n-1
for a in range(1,n-1):
    while s_i[d-1] >= s_i[d]:
        cn = cn + 1
        d = d-1
    if cn != 0:
        cnt.extend([cn])
        r = r + 1
    cn = 0
    d = d -1

max = cnt[0]
while cn < r:
    if max < cnt[cn]:
        max = cnt[cn]
    cn = cn + 1

print(max)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input().split()
s_i = [int(d) for d in s]
cnt = [0]
cn = 0
r = 1
d = n-a
for a in range(1,n-1):
    while s_i[d-1] >= s_i[d]:
        cn = cn + 1
        d = d-1
    if cn != 0:
        cnt.extend([cn])
        r = r + 1
    cn = 0
    d = d -1

max = cnt[0]
while cn < r:
    if max < cnt[cn]:
        max = cnt[cn]
    cn = cn + 1

print(max)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input().split()
s_i = [int(d) for d in s]
cnt = [0]
cn = 0
r = 1
for a in range(1,n-1):
    d = n-a
    while s_i[d-1] >= s_i[d]:
        cn = cn + 1
        d = d-1
    if cn != 0:
        cnt.extend([cn])
        r = r + 1
    cn = 0

max = cnt[0]
while cn < r:
    if max < cnt[cn]:
        max = cnt[cn]
    cn = cn + 1

print(max)
Problem p02924 (python)

Fixed submission:
N = int(input())
print((N-1)*N//2)

Buggy submission (verdict: Runtime Error):
a = int(input())
  c=0
for i in range(a)
  c = i+c
print(c)
Problem p02882 (python)

Fixed submission:
import math

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

if a*b*a/2 < x:
    c = 2*x/(a*a) - b
    if b == c:
        print(0)
    else:
        d = a*b/(b-c)
        print(90-math.degrees(math.atan(d/b)))
else:
    c = (2*x)/(a*b)
    print(90 - math.degrees(math.atan(c/b)))

Buggy submission (verdict: Runtime Error):
import math

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

if a*b*a/2 < x:
    if a == 1 and b == 1 and x == 1:
        print(0)
    else:
        c = 2*x/(a*a) - b
        d = a*b/(b-c)
        print(90-math.degrees(math.atan(d/b)))
else:
    c = (2*x)/(a*b)
    print(90 - math.degrees(math.atan(c/b)))

Buggy submission (verdict: Runtime Error):
import math

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

if a*b*a/2 < x:
    c = 2*x/(a*a) - b
    d = a*b/(b-c)
    print(90-math.degrees(math.atan(d/b)))
else:
    c = (2*x)/(a*b)
    print(90 - math.degrees(math.atan(c/b)))

Buggy submission (verdict: Runtime Error):
import math

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

c = (2*x)/(a*b)
if a*b*a/2 < x:
    c = 2*x/(a*a) - b
    d = a*b/(b-c)
    print(90-math.degrees(math.atan(d/b)))
else:
    print(90 - math.degrees(math.atan(c/b)))
Problem p02969 (python)

Fixed submission:
r = int(input())
print(3 * r*r)

Buggy submission (verdict: Runtime Error):
r = int(input())
print((3 * r*r)
Problem p02945 (python)

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

Buggy submission (verdict: Runtime Error):
import heapq
n,m = map(int,input().split())
l = []
for i in range(n):
  a,b = map(int,input().split())
  l.append([a,b])
l = sorted(l, key=lambda x: (x[0],x[1]))
b = []
heapq.heapify(l)
j = 0
q = 0
for i in range(m):
  key = i+1
  if j >= n+1:
    break
  while j < n:
    if l[j][0] != key:
      break
    heapq.heappush(b,-l[j][1])
    j += 1
  if b != []:
    heapq.heapify(b)
    k = -heapq.heappop(b)
    q += k
print(q)
Problem p03014 (python)

Fixed submission:
import numpy as np
h,w = map(int,input().split())
s = np.array([[1 if i == "." else 0 for i in input()] for j in range(h)])
l,r,u,d = np.zeros((h,w)),np.zeros((h,w)),np.zeros((h,w)),np.zeros((h,w))
for i in range(h):
  u[i] = (u[i-1]+1)*s[i]
  d[-i-1] = (d[-i]+1)*s[-i-1]
for i in range(w):
  l[:,i] = (l[:,i-1]+1)*s[:,i]
  r[:,-i-1] = (r[:,-i]+1)*s[:,-i-1]
print(int(np.max(l+r+u+d))-3)

Buggy submission (verdict: Runtime Error):
import numpy
h,w=map(int,input().split())
a = []
for i in range(h):
  l = input()
  l = list(l)
  a.append(l)

L = []
R = []
for i in range(h):
  l = []
  r = []
  k = 0
  m = 0
  for j in range(w):
    if a[i][w-j-1] == ".":
      k += 1
    else:
      k = 0
    if a[i][j] == ".":
      m += 1
    else:
      m = 0
    r.insert(0,k)
    l.append(m)
  R.append(r)
  L.append(l)

D = []
U = []
for i in range(h):
  D.append([])
  U.append([])
for i in range(w):
  k = 0
  m = 0
  for j in range(h):
    if a[j][i] == ".":
      k += 1
    else:
      k = 0
    if a[h-j-1][i] == ".":
      m += 1
    else:
      m = 0
    U[j].append(k)
    D[h-j-1].append(m)
A = numpy.array(L)+numpy.array(R)+numpy.array(U)+numpy.array(D)
print(max(numpy.amax(A-3),0))
Problem p02850 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)
N = int(input())
v = [[] for i in range(N)]
for i in range(N-1):
    a,b = map(int,input().split())
    a,b = a-1,b-1
    v[a].append([b,i])

ans = [None] * (N-1)

def decide_colord(cur,color):
    cnt = 1
    for (to,j)in v[cur]:
        if cnt == color:
            cnt += 1
        ans[j] = cnt
        decide_colord(to,cnt)
        cnt += 1
decide_colord(0,0)
print(max(ans))
[print(a) for a in ans]

Buggy submission (verdict: Runtime Error):
N = int(input())
v = [[] for i in range(N)]
for i in range(N-1):
    a,b = map(int,input().split())
    a,b = a-1,b-1
    v[a].append([b,i])

ans = [None] * (N-1)

def decide_colord(cur,color):
    cnt = 1
    for (to,j)in v[cur]:
        if cnt == color:
            cnt += 1
        ans[j] = cnt
        decide_colord(to,cnt)
        cnt += 1
decide_colord(0,0)
print(max(ans))
[print(a) for a in ans]
Problem p02887 (python)

Fixed submission:
N = int(input())
S = list(input())
#print(S)
count = 1
for i in range(N):
    if i == 0:
        continue
    elif S[i-1] != S[i]:
        count += 1

print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = int(input())
count == 0
for i in range(N):
    if S[i+1] != S[i]:
        count += 1

print(count)
Problem p02947 (python)

Fixed submission:
N = int(input())
s = list(list(input())for i in range(N))
count = 1
ans = 0
for i in range(N):
    s[i].sort()
s.sort()
for i in range(0,N-1):
    if s[i] == s[i+1]:
        ans += count
        count += 1
    else:
        count = 1
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np

N = int(input())
a = []
b = []
c = np.array([[0]*26,[0]*26,[0]*26])
count = 0
for i in range(N):
    a.append(input())

for i in range(N):
    b = a[i]
    for j in range(10):
        if b[j] == 'a':
            c[i][0] +=1
        elif b[j] == 'b':
            c[i][1] +=1
        elif b[j] == 'c':
            c[i][2] +=1
        elif b[j] == 'd':
            c[i][3] +=1
        elif b[j] == 'e':
            c[i][4] +=1
        elif b[j] == 'f':
            c[i][5] +=1
        elif b[j] == 'g':
            c[i][6] +=1
        elif b[j] == 'h':
            c[i][7] +=1
        elif b[j] == 'i':
            c[i][8] +=1
        elif b[j] == 'j':
            c[i][9] +=1
        elif b[j] == 'k':
            c[i][10] +=1
        elif b[j] == 'l':
            c[i][11] +=1
        elif b[j] == 'm':
            c[i][12] +=1
        elif b[j] == 'n':
            c[i][13] +=1
        elif b[j] == 'o':
            c[i][14] +=1
        elif b[j] == 'p':
            c[i][15] +=1
        elif b[j] == 'q':
            c[i][16] +=1
        elif b[j] == 'r':
            c[i][17] +=1
        elif b[j] == 's':
            c[i][18] +=1
        elif b[j] == 't':
            c[i][19] +=1
        elif b[j] == 'u':
            c[i][20] +=1
        elif b[j] == 'v':
            c[i][21] +=1
        elif b[j] == 'w':
            c[i][22] +=1
        elif b[j] == 'x':
            c[i][23] +=1
        elif b[j] == 'w':
            c[i][24] +=1
        elif b[j] == 'z':
            c[i][25] +=1
for i in range(N):
    for j in range(1,N):
        if i != j:
            if (c[i] == c[j]).all():
                count += 1
    
print(count)
Problem p02953 (python)

Fixed submission:
N = int(input())
h = list(map(int,input().split()))
ans = True
for i in range(N-2,-1,-1):
    if h[i] > h[i+1]:
        h[i]-=1
for i in range(N-1):
    if h[i] <= h[i+1]:
        ans = True
    else:
        ans = False
        break
if ans:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
h = list(map(int,input().split()))
ans = True
for i in range(N-1,-1,-1):
    if h[i] > h[i+1]:
        h[i]-=1
for i in range(N-1):
    if h[i] <= h[i+1]:
        ans = True
    else:
        ans = False
        break
if ans:
    print('Yes')
else:
    print('No')

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

for i in range(N-1):
    if h[i] > h[i+1]:
        h[i] -= 1
for i in range(N-1):
    if h[i] > h[i+1]:
        print('No')
        sys.exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
N = int(input())
h = list(map(int,input().split()))
flag = 0
if N == 1:
    print("Yes")
else:
    for i in range(N-1):
        if h[i] > h[i+1]:
            h[i] -= 1
    for i in range(N-1):
        if h[i] <= h[i+1]:
            flag = 1:
        else:
            flag = 0:
            break
    if flag == 1:
        print('Yes')
    else:
        print('No')

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

for i in range(1,N):
    if h[i-1] > h[i]:
        h[i-1] -= 1

for i in range(1,N):
    if h[i-1] <= h[i]:
        flag = 1
    else:
        flag = 0
        break

if flag == 1:
    print('Yes')
else:
    print('No')
N = int(input())
h = list(map(int,input().split()))
flag = 0

for i in range(1,N):
    if h[i-1] > h[i]:
        h[i-1] -= 1

for i in range(1,N):
    if h[i-1] <= h[i]:
        flag = 1
    else:
        flag = 0
        break

if flag == 1:
    print('Yes')
else:
    print('No')

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

for i in range(1,N):
    if h[i-1] > h[i]:
        h[i-1] -= 1

for i in range(1,N):
    if h[i-1] <= h[i]:
        flag = 1
    else:
        flag = 0
        break

if flag == 1:
    print('Yes')
else:
    print('No')
Problem p03001 (python)

Fixed submission:
w,h,x,y = map(int,input().split())

print(w*h/2,end = ' ')
if w/2==x and h/2==y:
    print('1')
else:
    print('0')

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

print(w*h/2,end = ' ')
if w/2==x and h/2==y:
    pirnt('1')
else:
    print('0')