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

Fixed submission:
n = int(input())

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

b = [0 for i in range(10**5+1)]

for i in range(n):
    if a[i] == 0:
        b[a[i]] += 1
        b[a[i]+1] += 1
    else:
        b[a[i]-1] += 1
        b[a[i]] += 1
        b[a[i]+1] += 1
print(max(b))

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

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

b = [[0]*(10**5+1)]

for i in range(n):
    if a[i] == 0:
        b[a[i]] += 1
        b[a[i]+1] += 1
    else:
        b[a[i]-1] += 1
        b[a[i]] += 1
        b[a[i]+1] += 1
print(max(b))
Problem p03625 (python)

Fixed submission:
a  =  int(input())

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

b.sort()

c = 1
d = 0
dd = 0

p = b[0]

for i in range(1,a):
	if p == b[i]:
		c += 1
	elif p != b[i]:
		p = b[i]
		c = 1
	if c == 2:
		d = dd
		dd = p
	elif c == 4:
		d = p
		dd = p

print(d*dd)

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

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

b.sorted()

c = 1
d = 0
dd = 0

p = b[0]

for i in range(1,a):
	if p == b[i]:
		c += 1
	elif p != b[i]:
		p = b[i]
		c = 1
	if c == 2:
		d = dd
		dd = p
	elif c == 4:
		d = p
		dd = p

print(d*dd)
Problem p03637 (python)

Fixed submission:
b = int(input())

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

co = 0
s = 0
ss = 0

for i in range(len(a)):
  while a[i] % 2 == 0:
    co += 1
    a[i] //= 2
  if co == 1:
    s += 1
  elif co >= 2:
    ss += 1
  co = 0
  
b -= s

if b % 2 == 1 and s > 0:
  b += 1
elif b % 2 == 1 and s == 0:
  b -= 1
b //= 2

if ss >= b:
  print("Yes")
else:
  print("No")

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

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

co = 0
s = 0
ss = 0

for i in range(len(a)):
  while a[i] % 2 == 0:
    co += 1
    a[i] //= 2
  if co == 1:
    s += 1
  elif co >= 2:
    ss += 1
  
b -= s

if b % 2 == 1 && s > 0:
  b += 1
elif b % 2 == 1 && s == 0:
  b -= 1
b //= 2

if ss >= b:
  print("Yes")
else:
  print("No")
Problem p03643 (python)

Fixed submission:
i = int(input())
print("ABC"+str(i))

Buggy submission (verdict: Runtime Error):
i = int(input())
print("ABC"i)

Buggy submission (verdict: Runtime Error):
i = int(input())
print("ABC"+i)
Problem p03644 (python)

Fixed submission:
i = [1,2,4,8,16,32,64,128]
k = int(input())
 
for p in range(len(i)):
  if k == 1:
    print(1)
    break
  elif k < i[p]:
    print(i[p-1])
    break

Buggy submission (verdict: Runtime Error):
i = {1,2,4,8,16,32,64,128}
k = int(input())
 
for p in range(len(i)):
  if k == 1:
    print(1)
    break
  elif k < i[p]:
    print(i[p-1])
    break

Buggy submission (verdict: Runtime Error):
i = {1,2,4,8,16,32,64,128}
k = int(input())
 
for p in range(len(i)):
  if k == 1:
    print(1)
  elif k < i[p]:
    print(i[p-1])
    break

Buggy submission (verdict: Runtime Error):
i = {1,2,4,8,16,32,64,128}
k = int(input())

for p in range(len(i)):
  if k <= i[p]:
    print(i[p])
    break
Problem p03645 (python)

Fixed submission:
import sys
n,m = map(int,input().split())

a = [list(map(int,input().split()))for i in range(m)]

a.sort()

k = [0 for i in range(n)]

for i in range(m):
    if a[i][0] != 1:
        break
    else:
        k[a[i][1]-1] = 1

for i in range(m):
    if k[a[i][0]-1] == 1:
        if a[i][1] == n:
            print("POSSIBLE")
            sys.exit()
print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
import collections
da = list(map(int,input().split()))
a[] = []
b[] = []
for i in range(da[1]):
  k[i] = list(map(int,input().split()))
  
for i in range(da[1]):
  if k[i][0] == 1 or k[i][1] == 1:
    a.append(k[i])

for i in range(da[1]):
  if k[i][0] == da[0]or k[i][1] == da[0]:
    b.append(k[i])
    
a = list(set(a))
b = list(set(b))
 
for i in range(len(a)):
  b.append(a[i])
c = collections.Counter(b)
 
for i in range(len(c)):
  if c[i][1] >1:
    print("POSSIBLE")
    break
  else:
    print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
import collections
da = list(map(int,input().split()))
a[] = []
b[] = []
for i in range(da[1]):
  k[i] = list(map(int,input().split()))
  
for i in range(da[1]):
  if k[i][0] == 1 or k[i][1] == 1:
    a.append(k[i])
 
for i in range(da[1]):
  if k[i][0] == da[0]or k[i][1] == da[0]:
    b.append(k[i])
    
a = list(set(a))
b = list(set(b))
 
k = a+b
c = collections.Counter(k)
 
for i in range(len(c)):
  if c[i][1] >1:
    print("POSSIBLE")
    break
  else:
    print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
import collections
da = list(map(int,input().split()))
a[] = []
b[] = []
for i in range(da[1]):
  k[i] = list(map(int,input().split()))
  
for i in range(da[1]):
  if k[i][0] == 1 or k[i][1] == 1:
    a.append(k[i])

for i in range(da[1]):
  if k[i][0] == da[0]or k[i][1] == da[0]:
    b.append(k[i])
    
a = list(set(a))
b = list(set(b))

k = a+b
c = collections.Counter(k)

for i in range(len(c)):
  if c[i][1] >1:
    print("POSSIBLE")
    break
  else
    print("IMPOSSIBLE")
Problem p03659 (python)

Fixed submission:
a = int(input())

aa = list(map(int,input().split()))

for i in range(1,a):
  aa[i] += aa[i-1]
  
su = 10**20

for i in range(a-1):
  su = min(su,abs(aa[a-1]-2*aa[i]))
print(su)

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

aa = list(map(int,input().split()))

for i in range(1,a):
  aa[i] += a[i-1]
  
su = 10**20

for i in range(a):
  su = min(su,abs(aa[a-1]-2*aa[i]))
print(su)

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

aa = list(map(int,input().split()))

for i in range(1,a):
  aa[i] += a[i-1]
  
su = 10**20

for i in range(a):
  su = min(su,abs(aa[a-1]-2*a[i]))
print(su)

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

aa = list(map(int,input().split()))

for i in range(1,a):
  aa[i] += a[i-1]
  
su = 10**20

for i in range(a):
  su = min(su,abs(aa[a-1]-2*a[i]))
print(sU)
Problem p03699 (python)

Fixed submission:
n = int(input())

a = []
b = []

for i in range(n):
    k = int(input())
    if k % 10 == 0:
        a.append(k)
    else:
        b.append(k)

if len(b) == 0:
    print(0)
else:
    b.sort()
    su = sum(a) + sum(b)
    if su % 10 == 0:
        su -= b[0]
    print(su)

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

a = []
b = []

for i in range(n):
    k = int(input())
    if k % 10 == 0:
        a.append(k)
    else:
        b.append(k)

su = sum(a)

b.sort()

su += sum(b) - b[0]
print(su)
Problem p03713 (python)

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

ans = 10**10

if h * w % 3 == 0:
    print(0)
    exit()

ans = min(ans,w,h)

for i in range(1,h//2+1):
    a = [w * i, (h - i) * (w // 2), (h - i) * (w // 2 + w % 2)]
    a.sort()
    ans = min(ans, a[2] - a[0])
for i in range(1, w//2+1):
    a = [h * i, (w - i) * (h // 2), (w - i) * (h // 2 + h % 2)]
    a.sort()
    ans = min(ans, a[2] - a[0])
print(ans)

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

ans = 10**10

if h * w % 3 == 0:
    print(0)
    exit()

ans = min(ans,w,h)

for i in range(1,h//2+1):
    a = [w * j, (h - j) * (w // 2), (h - j) * (w // 2 + w % 2)]
    a.sort()
    ans = min(ans, a[2] - a[0])
for i in range(1, w//2+1):
    a = [h * j, (w - j) * (h // 2), (w - j) * (h // 2 + h % 2)]
    a.sort()
    ans = min(ans, a[2] - a[0])
print(ans)
Problem p03738 (python)

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

if a > b:
  print("GREATER")
elif a == b:
  print("EQUAL")
else:
  print("LESS")

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

a = [list(input()) for i in range(n)]

h = []
l = []
co = 0
for i in range(n):
    co = 0
    for j in range(m):
        if a[i][j] == "#":
            co = 1
    if co == 0:
        l.append(i)
for i in range(m):
    co = 0
    for j in range(n):
        if a[j][i] == "#":
            co = 1
    if co == 0:
        h.append(i)

for i in range(len(l)):
    a.pop(l.pop())

for i in range(len(h)):
    p = h.pop()
    for j in range(len(a)):
        a[j].pop(p)

for i in range(len(a)):
    print("".join(a[i]))

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

if a > b:
  print("GREATER")
elif a == b:
  print("EQUAL")
else:
  print("LESS")
Problem p03739 (python)

Fixed submission:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    if len(x) == 0:
        return []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def pow_k(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans

"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

n = onem()

a = l()

po = [a[i] for i in range(n)]

for i in range(1,n):
    po[i] += po[i-1]

co = 0

ans = 0

for i in range(n):
    po[i] += co
    if i % 2 == 0:
        if po[i] > 0:
            continue
        else:
            co += abs(po[i]) + 1
            ans += abs(po[i]) + 1

    else:
        if po[i] < 0:
            continue
        else:
            co -= abs(po[i]) + 1
            ans += abs(po[i]) + 1
anss = 0
co = 0
po = [a[i] for i in range(n)]

for i in range(1,n):
    po[i] += po[i-1]

for i in range(n):
    po[i] += co
    if i % 2 != 0:
        if po[i] > 0:
            continue
        else:
            co += abs(po[i]) + 1
            anss += abs(po[i]) + 1

    else:
        if po[i] < 0:
            continue
        else:
            co -= abs(po[i]) + 1
            anss += abs(po[i]) + 1
print(min(ans,anss))

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

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

if a[0] != 0:
    b = [a[0]]
else:
    su += 1
    if b[1] > 0:
        b = [-1]
    else:
        b = [1]
su = 0
for i in range(n-1):
    b.append(b[-1]+a[1+i])
    if b[-1] * b[-2] > 0:
        su += abs(b[-1]) + 1
        if b[-2] > 0:
            b[-1] = -1
        else:
            b[-1] = 1
    else:
        if b[-1] == 0:
            su += 1
            if b[-2] > 0:
                b[-1] = -1
            else:
                b[-1] = 1
print(su)
Problem p03779 (python)

Fixed submission:
a = int(input())
i = 1
j = 0
ans = 0
while True:
    ans += 1
    j += i
    i += 1
    if j >= a:
      print(ans)
      break

Buggy submission (verdict: Runtime Error):
a = int(input())
i = 1
j = 0
ans = 0
while True:
	ans += 1
    j += i
    i += 1
    if j >= a:
      print(ans)
      break
Problem p03814 (python)

Fixed submission:
a = list(input())

for i in range(len(a)):
  if a[i] == "A":
    k = i
    break
for i in range(len(a)-1,0,-1):
  if a[i] == "Z":
    kk = i
    break
print(kk-k+1)

Buggy submission (verdict: Runtime Error):
a = list(input())

for i in range(len(a)):
  if a[i] == "A":
    k = i
for i in range(len(a),0,-1):
  if a[i] == "Z":
    kk = i
print(kk-k+1)
Problem p03831 (python)

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

su = 0
c = [0]
for  i in range(len(b)-2):
	c.append(0)

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

for i in range(len(c)):
	if a[2] <= c[i]*a[1]:
		su += a[2]
	else:
		su += c[i]*a[1]

print(su)

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

su = 0
c = [0]
for  i in range(len(b)-2):
	c.append(0)

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

for i in range(len(c)):
	if a[2] <= c[i]*a[1]:
		su += a[2]
	else:
		su += c[i]*a[1]

print(su
Problem p03846 (python)

Fixed submission:
n = int(input())

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

b = [0 for i in range(10**5*1)]

for i in range(n):
    b[a[i]] += 1
if n % 2 == 0:
    if all(list(map(lambda x:x==2,b[1:n+1:2]))):
        print(2**(n//2)%(10**9+7))
    else:
        print(0)

else:
    if all(list(map(lambda x:x == 2,b[2:n+1:2]))) and b[0] == 1:
        print(2**(n//2)%(10**9+7))
    else:
        print(0)

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

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

b = [0 for i in range(10**5)]

for i in range(n):
    b[a[i]] += 1
if n % 2 == 0:
    if sum(b[::2]) == 0 and all(list(map(lambda x:x==2),b[1::2])):
        print(2**(n//2))
    else:
        print(0)

else:
    print(b[1:n//2:2],list(map(lambda x:x == 2,b[:n//2:2])))
    if sum(b[1::2]) == 0 and all(list(map(lambda x:x == 2,b[::2]))) and b[0] == 1:
        print(2**(n//2))
    else:
        print(0)
Problem p03862 (python)

Fixed submission:
f,g = list(map(int,input().split()))

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

c = 0
p = 1
if a[0] > g:
    c += a[0] - g
    a[0] = g
while p <= f-1:
    if a[p-1] + a[p] > g:
        eat = a[p-1] + a[p] - g
        c += eat
        a[p] -= eat
    p += 1
print(c)

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

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

c = 1
p = 0
if a[0] > g:
    c += a[0] - g
    a[0] = g
while p <= f-1:
    if a[p-1] + a[p] > x:
        eat = a[p-1] + a[p] - x
        c += eat
        a[p] -= eat
    p += 1
print(c)

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

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

c = 1
p = 0
if a[0] > g:
    c += a[0] - g
    a[0] = g
while p <= f-1:
    if a[p-1] + a[p] > x:
        eat = a[p-1] + a[p] - x:
        c += eat
        a[p] -= eat
    p += 1
print(c)

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

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

c = 0
p = 0
if a[0] > g:
    c += a[0] - g
    a[0] = g
while p <= f-1:
    if a[p-1] + a[p] > x:
        eat = a[p-1] + a[p] - x:
        c += eat
        a[p] -= eat
    p += 1
print(c)

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

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

c = 0
p = 0
if a[0] > g:
    c += a[0] - g
    a[0] = g
while p <= f-1:
    if a[p-1] + a[p] > x:
        eat = a[p-1] + a[p] - x:
        c += eat
        a[p] -= e
    p += 1
print(c)
Problem p03888 (python)

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

print((n*m)/(n+m))

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

print((n*m)/(n+m))
Problem p03889 (python)

Fixed submission:
n = list(input())

if len(n) % 2 == 0:
	for i in range(len(n)//2):
		if n[i] =="b":
			if n[-(i+1)] != "d":
				print("No")
				exit()
		elif n[i] == "p":
			if n[-(i+1)] != "q":
				print("No")
				exit()
		elif n[i] == "d":
			if n[-(i+1)] != "b":
				print("No")
				exit()
		elif n[i] == "q":
			if n[-(i+1)] != "p":
				print("No")
				exit()
	print("Yes")
else:
	print("No")

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

if n % 2 == 0:
	for i in range(len(n)//2):
		if n[i] =="b":
			if n[-(i+1)] != "d":
				print("No")
				exit()
		elif n[i] == "p":
			if n[-(i+1)] != "q":
				print("No")
				exit()
		elif n[i] == "d":
			if n[-(i+1)] != "b":
				print("No")
				exit()
		elif n[i] == "q":
			if n[-(i+1)] != "p":
				print("No")
				exit()
	print("Yes")
else:
	print("No")
Problem p04031 (python)

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

b = sum(a)//n

co = 10**9
su = 0
for k in range(3):
    for i in a:
        su += abs(i-b+(k-1)) ** 2
    co = min(co,su)
    su = 0

print(co)

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

b = mean(a)//1

co = 10**9
su = 0
for k in range(3):
    for i in a:
        su += abs(i-b+(k-1)) ** 2
    co = min(co,su)
    su = 0

print(co)
Problem p04043 (python)

Fixed submission:
da = list(map(int,input().split()))
a = 0
k = 0
for i in range(3):
  if  da[i] == 5:
    a += 1
  elif da[i] == 7:
    k += 1
 
if a == 2 and k == 1:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
da = list(map(int,input(),split()))
a = 0
k = 0
for i in range(3):
  if  da[i] == 5:
    a += 1
  elif da[i] == 7:
    k += 1

if a == 2 and k == 1:
  print("YES")
else:
  print("NO")
Problem p04045 (python)

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

c = input().split()

while 1:
    f = 1
    s = str(a)
    for i in c:
        if i in s: f = 0
    if f : break
    a += 1
print(a)

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

c = input().split()

while 1:
    f = 1
    s = str(a)
    for i in c:
        if i in s: f = 0
    if f : break
    c += 1
print(c)

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

c = input().split()

while 1:
    f = 1
    s = str(c)
    for i in c:
        if i in s: f = 0
    if f : break
    c += 1
print(c)

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

c = input().split()

while 1:
    f = 1
    s = str(c)
    for i in s:
        if i in c: f = 0
    if f : break
    c += 1
print(c)

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

c = input().split()

while 1:
    f = 1
    s = str(c)
    for i in c:
        if i in c: f = 0
    if f : break
    c += 1
print(c)
Problem p04047 (python)

Fixed submission:
a = int(input())

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

b.sort()

su = 0

for i in range(a):
  su += b[2*i]
print(su)

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

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

b.sorted()

su = 0

for i in range(a-1):
  su += b[2*i]

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

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

b.sorted()

su = 0

for i in range(a):
  su += b[2*i]
Problem p03720 (python)

Fixed submission:
n, m = map(int, input().split())
d = {}
for i in range(1, n+1): d[i] = 0
for _ in [0]*m:
    a, b = map(int, input().split())
    d[a] += 1
    d[b] += 1
for i in d.values():
    print(i)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
d = {}
def f(n):
    if n not in d:
        d[n] = 1
    else:
        d[n] += 1
for _ in [0]*m:
    a, b = map(int, input().split())
    f(a)
    f(b)
for i in range(1, n+1):
    print(d[i])
Problem p02756 (python)

Fixed submission:
from collections import deque
s = deque(input())
n = int(input())
initial = True
for i in range(n):
    order = list(input().split())
    if len(order) == 3:
        if initial:
            if int(order[1]) == 1:
                s.appendleft(order[2])
            else:
                s.append(order[2])
        else:
            if int(order[1]) == 1:
                s.append(order[2])
            else:
                s.appendleft(order[2])
    else:
        initial = not initial
    
if initial:
    print(''.join(s))
else:
    print(''.join(s)[::-1])

Buggy submission (verdict: Runtime Error):
from collections import deque
s = deque()
n = int(input())
initial = "left"
for i in range(n):
    order = list(input().split())
    if len(order) == 3:
        if initial == "left":
            if int(order[1]) == 1:
                s.appendleft(order[2])
            else:
                s.append(order[2])
        else:
            if int(order[1]) == 1:
                s.append(order[2])
            else:
                s.appendleft(order[2])
    else:
        initial = "right"
    
if initial == "left":
    print(s)
else:
    print(s[::-1])

Buggy submission (verdict: Runtime Error):
s = deque()
n = int(input())
initial = "left"
for i in range(n):
    order = list(input().split())
    if len(order) == 3:
        if initial == "left":
            if int(order[1]) == 1:
                s.appendleft(order[2])
            else:
                s.append(order[2])
        else:
            if int(order[1]) == 1:
                s.append(order[2])
            else:
                s.appendleft(order[2])
    else:
        initial = "right"
    
if initial == "left":
    print(s)
else:
    print(s[::-1])
Problem p02761 (python)

Fixed submission:
n, m =map(int,input().split())
a = [-1] * n
flg = True
for i in range(m):
    s, c = map(int,input().split())
    if a[s-1] == -1:
        a[s-1] = c
    elif a[s-1] == c:
        pass
    else:
        flg = False
        break
        
if n >= 2:
    if a[0] == 0:
        flg = False
    elif a[0] == -1:
        a[0] = 1
else:
    if a[0] == -1:
        a[0] = 0
    
if flg:
    num = 0
    for i in range(len(a)):
        if a[i] != -1:
            num += a[i] * (10**(n-i-1))
    print(num)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
n, m =map(int,input().split())
a = [0] * m
flg = True
for i in range(m):
    s, c = map(int,input().split())
    if a[s-1] == 0:
        a[s-1] = c
    elif a[s-1] == c:
        pass
    else:
        flg = False
        break
if a[0] == 0:
    flg = False

if flg:
    num = 0
    for i in range(len(a)):
        num += a[i] * (10**(m-i-1))
    print(num)
else:
    print(-1)
Problem p02882 (python)

Fixed submission:
import math
a, b, x = map(int, input().split())
if x <= 0.5 * a*a*b:
    ans = math.pi / 2 - math.atan(2*x / (b*b*a))
    print(ans / (math.pi/ 4) * 45)
elif x == a * a *b:
    print(0)
else:
    ans = math.atan(a*a*a / (2*a*a*b - 2*x))
    print(90 - ans / (math.pi/ 4) * 45)

Buggy submission (verdict: Runtime Error):
import math
a, b, x = map(int, input().split())
if x <= 0.5 * a*a*b:
    ans = math.pi / 2 - math.atan(2*x / (b*b*a))
    print(ans / (math.pi/ 4) * 45)
else:
    ans = math.atan(a*a*a / (2*a*a*b - 2*x))
    print(90 - ans / (math.pi/ 4) * 45)
Problem p02923 (python)

Fixed submission:
N = int(input())
nums = list(map(int, input().split()))
count = 0
max_count = 0
right = 0
while True:
    if right == N-1:
        break
    
    if nums[right+1] <= nums[right]:
        count += 1    
    else:
        count = 0
        
    if max_count < count:
        max_count = count
        
    right += 1
    
print(max_count)

Buggy submission (verdict: Runtime Error):
N = int(input())
nums = list(map(int, input().split()))
count = 0
max_count = 0
right = 0
while True:
    if nums[right+1] <= nums[right]:
        count += 1    
    else:
        count = 0
        
    if max_count < count:
        max_count = count
        
    right += 1
    if right == N-1:
        break
    
print(max_count)

Buggy submission (verdict: Runtime Error):
N = int(input())
nums = list(map(int, input().split()))
count = 0
max_count = []
right = 0
while True:
    if nums[right+1] <= nums[right]:
        count += 1    
    else:
        max_count.append(count)
        count = 0
        
    right += 1
    if right == N-1:
        break
    
print(max(max_count))

Buggy submission (verdict: Runtime Error):
N = int(input())
nums = list(map(int, input().split()))
count = 0
max_count = 0
right = 0
while True:
    if nums[right+1] <= nums[right]:
        count +=1
        right += 1
    else:
        count = 0
        right += 1
        
    if max_count < count:
        max_count = count
    
    if right == N-1:
        break
    
print(max_count)

Buggy submission (verdict: Runtime Error):
N = int(input())
nums = list(map(int, input().split()))
count = 0
max_count = 0
right = 1
while True:
    if nums[right] <= nums[right-1]:
        count +=1
        right += 1
    else:
        count = 0
        right += 1
        
    if max_count < count:
        max_count = count
    
    if right == N:
        break
    
print(max_count)

Buggy submission (verdict: Runtime Error):
N = int(input())
nums = list(map(int, input().split()))
count = 0
max_count = 0
left = 0
right = 1
while True:
    if nums[right] <= nums[right-1]:
        count +=1
        right += 1
    else:
        count = 0
        right += 1
        left = right - 1
        
    if max_count < count:
        max_count = count
    
    if right == N:
        break
    
print(max_count)