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

Fixed submission:
N, L = map(int, input().split())
a = [0] * N
for i in range(N):
  a[i] = input()
a.sort()
for i in range(N):
  print(a[i], end='')

Buggy submission (verdict: Runtime Error):
N, L = map(int, input().split())
a = [0] * L
for i in range(N):
  a[i] = input()
a.sort()
for i in range(N):
  print(a[i], end='')
Problem p02922 (python)

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

Buggy submission (verdict: Runtime Error):
A,B = map(int, input().split())
print((b-1)//(a-1))
Problem p04043 (python)

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

Buggy submission (verdict: Runtime Error):
a = list[input().split()]
if a.count("5") == 2 and a.count("7")==1:
  print("YES")
else:
  print("NO")
Problem p03079 (python)

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

Buggy submission (verdict: Runtime Error):
N,Q = map(int,input().split(" "))
s_lst = list(input().rstrip())

pos_cnt=[1 for _ in range(N+2)]
c_ind_dict = {c:[] for c in set(s_lst)}
for i,c in enumerate(s_lst):
	c_ind_dict[c].append(i+1)

for _ in range(Q):
	c,d = input().split(" ")
	if c not in c_ind_dict.keys():
		continue
	for ind in  c_ind_dict[c]:
		if d == "L":
			pos_cnt[ind - 1] += pos_cnt[ind]
			pos_cnt[ind] = 0
		else:
			pos_cnt[ind + 1] += pos_cnt[ind]
			pos_cnt[ind] = 0

print(sum(pos_cnt[1:N+1]))
Problem p03109 (python)

Fixed submission:
y,m,d = [int(s) for s in input().rstrip().split("/")]

if y == 2019:
  if m >= 5:
    print("TBD")
    exit()
elif y > 2019:
  print("TBD")
  exit()

print("Heisei")

Buggy submission (verdict: Runtime Error):
import pandas as pd
date = pd.to_datetime(input().rstrip())
if date > pd.to_datetime("2019/4/30"):
  print("TBD")
else:
  print("Heisei")

Buggy submission (verdict: Runtime Error):
import pandas as pd
date = pd.to_datetime(input().rstrip())
if date > pd.to_datetime("2019/4/30"):
  print("TBD)
else:
  print("Heisei")
Problem p04047 (python)

Fixed submission:
import bisect

N = input()
Ls = map(int,input().split(" "))
Ls = sorted(Ls)
ans = sum([L for i,L in enumerate(Ls) if i%2 == 0])
print(ans)

Buggy submission (verdict: Runtime Error):
def f(a,b):
	if a==b:
		return 2*a
	elif a < b:
		return 2*a* + f(a,b-a)
	else:
		return 2*b + f(a-b,b)


N,X = map(int,input().split(" "))

print(N+f(N-X,X))
Problem p04048 (python)

Fixed submission:
def f(a,b):
	if a==b:
		d=0
		ret = a
	elif a < b:
		d = b//a
		if b%a == 0:
			ret = a*(2*d -1)
		else:
			ret = 2*a*d + f(a,b%a)
	else:
		d = a//b
		if a%b == 0:
			ret = b*(2*d -1)
		else:
			ret = 2*b*d + f(a%b,b)
	#print(a,b,d,ret)
	return ret


N,X = map(int,input().split(" "))

print(N+f(N-X,X))

Buggy submission (verdict: Runtime Error):
def f(a,b):
	if a==b:
		ret = a
	elif a < b:
		ret = 2*a + f(a,b-a)
	else:
		ret = 2*b + f(a-b,b)
	return ret


N,X = map(int,input().split(" "))

print(N+f(N-X,X))

Buggy submission (verdict: Runtime Error):
def f(a,b):
	if a==b:
		return 2*a
	elif a < b:
		return 2*a + f(a,b-a)
	else:
		return 2*b + f(a-b,b)


N,X = map(int,input().split(" "))

print(N+f(N-X,X))

Buggy submission (verdict: Runtime Error):
def f(a,b):
	return 2*a + f_fast(a,b-a)



def f_fast(a,b):
	if a==b:
		return a+b
	elif a < b:
		if b%a == 0:
			return f(a,b)
		else:
			d = b//a
			return 2*a*d + f_fast(a,b%a)
	else:
		return f_fast(b,a)


N,X = map(int,input().split(" "))

print(N+f_fast(N-X,X))

Buggy submission (verdict: Runtime Error):
def f(a,b):
	print(a,b)
	if a==b:
		return 2*a
	elif a < b:
		return 2*a + f(a,b-a)
	else:
		return 2*b + f(a-b,b)


N,X = map(int,input().split(" "))

print(N+f(N-X,X))
Problem p02713 (python)

Fixed submission:
import math

N = int(input())
 
ans = 0
for a in range(1, N + 1):
    for b in range(1, N + 1):
        tmp = math.gcd(a, b)
        for c in range(1, N + 1):
            ans += math.gcd(tmp, c)
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
 
ans = 0
for a in range(1, N + 1):
    for b in range(1, N + 1):
        tmp = math.gcd(a, b)
        for c in range(1, N + 1):
            ans += math.gcd(tmp, c)
 
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
N=list(range(1,n+1))
print(sum([gcd2(a,b,c) for a,b,c in [[a, b, c] for a in N for b in N for c in N]]))
Problem p03567 (python)

Fixed submission:
S = raw_input()
print 'Yes' if 'AC' in S else 'No'

Buggy submission (verdict: Runtime Error):
N = input()
if 'AC' in N:
    print 'Yes'
else:
    print 'No'
Problem p03693 (python)

Fixed submission:
if int(('').join(raw_input().split(' ')))%4==0:
	print('YES')
else:
	print('NO')

Buggy submission (verdict: Runtime Error):
N=input()
brac = raw_input()
ans = brac

while '()' in brac:
	brac=brac.replace('()','')

left=brac.count('(')
right=brac.count(')')

print '('*right +ans +')'*left
Problem p03694 (python)

Fixed submission:
N=input()
a=[int(n) for n in raw_input().split(' ')]
print(max(a)-min(a))

Buggy submission (verdict: Runtime Error):
N=input()
a=raw_input().split(' ')
print(max(a)-min(a))

Buggy submission (verdict: Runtime Error):
a=raw_input().split(' ')
print(max(a)-min(a))
Problem p03695 (python)

Fixed submission:
N=input()
nlist= [int(l) for l in raw_input().split(' ')]

rate= [0,0,0,0,0,0,0,0]
up = 0
for n in nlist:
	if n/400>=8:
		up += 1
	else:
		rate[n/400]=1

print max(1,sum(rate)),sum(rate)+up

Buggy submission (verdict: Runtime Error):
N=input()
nlist= [int(l) for l in raw_input().split(' ')]

rate= [0,0,0,0,0,0,0]
max = 0
for n in nlist:
	if n/400>=8:
		max += 1
	else:
		rate[n/400]=1

print(sum(rate)),
if sum(rate)+max > 8:
	print(8)
else:
	print(sum(rate)+max)

Buggy submission (verdict: Runtime Error):
N=input()
nlist= [int(l) for l in raw_input().split(' ')]

rate= [0,0,0,0,0,0,0]
max = 0
for n in nlist:
	if n/400>=8:
		max += 1
	rate[n/400]=1

print(sum(rate)),
if sum(rate)+max > 8:
	print(8)
else:
	print(sum(rate)+max)
Problem p02717 (python)

Fixed submission:
A = list(map(int, input().split()))
print(A[2], A[0], A[1])

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
A = list(map(int, input().split()))
x = sum(A)/(4*m)
count = 0
for a in A:
    if a >= x:
        count += 1
if count >= m:
    print("Yes")
else:
    print("No")
Problem p02719 (python)

Fixed submission:
N, K = map(int, input().split())
print(min(N%K, K-(N%K)))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
print(min(N%K, K(N%K)))
Problem p03076 (python)

Fixed submission:
food = [int(input()) for _ in range(5)]

total = 0
compare = 0
largest = 0

if sum(food)%10 == 0:
    print(sum(food))

else:
    for x in food:
        if (10 - (x % 10) > compare) and ((x % 10) != 0):
            largest = x
            compare = 10 - (x % 10)

    food.remove(largest)

    for i in range(len(food)):
        if food[i] % 10 != 0:
            total += round(food[i] + 5.1, -1)
        else:
            total += food[i]

    print(int(total+largest))

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

total = 0
compare = 0
largest = 0

for x in food:
    if (10 - (x % 10) > compare) and ((x % 10) != 0):
        largest = x
        compare = 10 - (x % 10)

food.remove(largest)

for i in range(len(food)):
    if food[i] % 10 != 0:
        total += round(food[i] + 5.1, -1)
    else:
        total += food[i]

print(int(total+largest))

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

total = 0
compare = 0
largest = 0

for x in food:
    if (10 - (x % 10) > compare) and ((x % 10) != 0):
        largest = x
        compare = 10 - (x % 10)

food.remove(largest)
print(largest)

for i in range(len(food)):
    if food[i] % 10 != 0:
        total += round(food[i] + 5.1, -1)
    else:
        total += food[i]

print(int(total+largest))

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

total = 0
compare = 0
largest = 0

for x in food:
    if (10 - (x % 10) and (x % 10) != 0) > compare:
        largest = x
food.remove(largest)

for i in range(len(food)):
    if food[i] % 10 != 0:
        total += round(food[i] + 5.1, -1)
    else:
        total += food[i]
print(int(total+largest))
Problem p03219 (python)

Fixed submission:
X,Y = map(int, input().split())
print(int(X+(Y/2)))

Buggy submission (verdict: Runtime Error):
X,Y = map(int, input().split())
print(int(X+(Y/2))
Problem p02789 (python)

Fixed submission:
A, B = map(int, input().split())
if A == B:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
if A == B:
    print('Yes')
else:
    print('No')
Problem p02900 (python)

Fixed submission:
from fractions import gcd
d = gcd(*map(int, input().split()))
r = 1
i = 2
while i * i <= d:
    r += d % i == 0
    while d % i == 0:
        d //= i
    i += 1
print(r + (d > 1))

Buggy submission (verdict: Runtime Error):
import collections
A, B = [int(x) for x in raw_input().split(' ')]
def reduceNum(n):
    res = collections.Counter()
    res[1] = 1
    while n != 1:
        for index in range(2, int(n + 1)):
            while n % index == 0:
                n /= index
                res[index] += 1
    return res
sa = reduceNum(A)
sb = reduceNum(B)
be = sa & sb
print(len(be))
Problem p02939 (python)

Fixed submission:
s = raw_input()
N = len(s)
s = '0' + s
dp = [0] * (1+N)
# dp[0] = 1
for i in xrange(1, N+1):
    if s[i] == s[i-1]:  dp[i] = dp[i-3]+2 if i >= 3 else 1
    else:   dp[i] = dp[i-1] + 1
print(dp[N])

Buggy submission (verdict: Runtime Error):
s = raw_input()
N = len(s)
if N == 1:
    print(1)
    exit()
dp = [[0] * 3 for _ in xrange(N)]
dp[0][1] = 1
dp[1][2] = 0
dp[1][1] = 0 if s[1] == s[0] else 2
for i in xrange(2, N):
    if dp[i-1][2]:
        dp[i][1] = max(dp[i][1], dp[i - 1][2] + 1)
    if dp[i-1][1] and s[i] != s[i-1]:
        dp[i][1] = max(dp[i][1], dp[i - 1][1] + 1)
    if dp[i-2][1]:
        dp[i][2] = dp[i-2][1]+1
    if i >= 3 and (s[i-2-1]!=s[i-1] or s[i-2]!=s[i]) and dp[i-2][2]:
        dp[i][2] = max(dp[i][2], dp[i-2][2]+1)
print(max(dp[N-1][1], dp[N-1][2]))
Problem p03684 (python)

Fixed submission:
N=int(input())
city=[0]*N
for i in range(N):
    x,y=map(int,input().split())
    city[i]=(i,x,y)
city.sort(key=lambda x:x[1])
data=[(city[i][0],city[i+1][0],city[i+1][1]-city[i][1]) for i in range(N-1)]
city.sort(key=lambda x:x[2])
data+=[(city[i][0],city[i+1][0],city[i+1][2]-city[i][2]) for i in range(N-1)]
data.sort(key=lambda x:x[2])
f = list(range(N))
costs = [1] * N
def find(x):
    if f[x] != x:
        f[x] = find(f[x])
    return f[x]
res = 0
for i, j, k in data:
    fi, fj = find(i), find(j)
    if fi == fj:
        continue
    else:
        if costs[fi] <= costs[fj]:
            f[fi] = fj
            costs[fj] += costs[fi]
            res += k
        else:
            f[fj] = fi
            costs[fi] += costs[fj]
            res += k
print(res)

Buggy submission (verdict: Runtime Error):
N=int(input())
city=[0]*N
for i in range(N):
    x,y=map(int,input().split())
    city[i]=(i,x,y)
city.sort(key=lambda x:x[1])
data=[(city[i][0],city[i+1][0],city[i+1][1]-city[i][1]) for i in range(N-1)]
city.sort(key=lambda x:x[2])
data+=[(city[i][0],city[i+1][0],city[i+1][2]-city[i][2]) for i in range(N-1)]
data.sort(key=lambda x:x[2])
f = list(range(N))
costs = [0] * N
def find(x):
    if f[x] != x:
        f[x] = find(f[x])
    return f[x]
res = 0
for i, j, k in data:
    fi, fj = find(i), find(j)
    if fi == fj:
        continue
    else:
        f[fi] = fj
        res += k
print(res)
Problem p02791 (python)

Fixed submission:
import sys
from operator import itemgetter
import collections

def r(n, p):
  m = n + 1
  count = 0
  for i in range(n):
    m = min([p[i], m])
    if m == p[i]:
      count += 1
  return count

def main():
    input = sys.stdin.readline
    n = int(input())
    p = list(map(int, input().split()))
    print(r(n,p))

    
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
from operator import itemgetter
import collections

def r(n, p):
  m = n + 1
  count = 0
  for i in range(n):
    m = min(p[i], m)
    if m == p[i]:
      count += 1
  return count

def main():
    input = sys.stdin.readline
    n = int(input())
    p = map(int, input().split())
    print(r(n,p))

    
if __name__ == '__main__':
    main()
Problem p03148 (python)

Fixed submission:
import sys

def r(n, k, sl):

    sl.sort(key=lambda x: -x[1])

    gmk = set()
    gop = 0
    ce = []
    for ti, di in sl[:k]:
        if ti in gmk:
            ce.append(di)
        gmk.add(ti)
        gop += di

    gscr = len(gmk)**2 + gop

    for ti, di in sl[k:]:
        if 0 >= len(ce):
            break
        if ti in gmk:
            continue
        gmk.add(ti)
        odi = ce.pop()
        gop = gop - odi + di
        nscr = len(gmk)**2 + gop
        gscr = max(gscr, nscr)

    return gscr


def main():
    input = sys.stdin.readline
    n, k = list(map(int, input().split()))
    sl = [tuple(map(int, input().split())) for _ in range(n)]
    print(r(n, k, sl))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import copy
import collections


def score(list):
    tl, dl = zip(*list)
    t_s = len(set(tl)) ** 2
    d_s = sum(dl)
    return t_s + d_s


def r(n, k, sl):
    
    tl, dl = zip(*sl)
    ztd = collections.Counter(tl)
    for _ in range(len(sl) - k):
        d_idx = dl.index(min(dl))
        tlv = tl[d_idx]
        if ztd[tlv] >= 2:
            del sl[d_idx]
        else:
            break

    for _ in range(len(sl) - k):

        ckl = {}
        for v in sl:
            if v[0] in ckl:
                if ckl[v[0]][1] > v[1]:
                    ckl[v[0]] = v
            else:
                ckl[v[0]] = v

        s_c = 0
        dtl = []
        for delckl in ckl.values():
            c_sl = copy.copy(sl)
            del c_sl[c_sl.index(delckl)]
            soe = score(c_sl)
            if s_c < soe:
                s_c = soe
                dtl = delckl

        del sl[sl.index(dtl)]

    return score(sl)


def main():
    n, k = list(map(int, input().split()))
    sl = [list(map(int, input().split())) for i in range(n)]
    print(r(n, k, sl))


if __name__ == '__main__':
    main()
Problem p02705 (python)

Fixed submission:
r = int(input())
print(r*2*3.141592653589793238462643383279502884197169399375105820974944592307816406286)

Buggy submission (verdict: Runtime Error):
 r = int(input())
print(R*2*3.14159265359)

Buggy submission (verdict: Runtime Error):
 r = int(input())
print(R*2*3.14)
Problem p02789 (python)

Fixed submission:
N,M = map(int,input().split())
if N == M:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
if N == M:
    print("Yes")
else:
    print(No)
Problem p02813 (python)

Fixed submission:
import itertools
N = int(input())
P = list(map(int,input().split()))
Q = list(map(int,input().split()))
num = 0
for v in list(itertools.permutations(range(1,N+1))):
    num += 1
    if list(v) == P:
        A = num
    elif list(v) == Q:
        B = num
    else:
        pass
try:
    print(abs(A-B))
except:
    print(0)

Buggy submission (verdict: Runtime Error):
import itertools
N = int(input())
P = list(map(int,input().split()))
Q = list(map(int,input().split()))
for i,v in enumerate(list(itertools.permutations(range(1,N+1))), 1):
    if list(v) == P:
        A = i
    elif list(v) == Q:
        B = i
    else:
        pass
try:
    print(abs(A-B))

Buggy submission (verdict: Runtime Error):
import itertools
N = int(input())
P = list(map(int,input().split()))
Q = list(map(int,input().split()))
num = 0
for v in list(itertools.permutations(range(1,N+1))):
    num += 1
    if list(v) == P:
        A = num
    elif list(v) == Q:
        B = num
    else:
        pass
print(abs(A-B))
Problem p02706 (python)

Fixed submission:
N,M=map(int,input().split())
A=list(map(int,input().split()))
print(N-sum(A) if N-sum(A) >=0 else -1)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input())
A=list(map(int,input()))
print(N-sum(A))
Problem p02789 (python)

Fixed submission:
n,m = map(int,input().split())
print("Yes" if m==n else "No")

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split)
print("Yes" if m==n else "No")
Problem p02797 (python)

Fixed submission:
import numpy as np
n,k,s = map(int,input().split())
a=np.arange(n)
if k>0 and s<1000000000:
  a[:k]=s
  a[k:]=s+1
elif k>0 and s>=1000000000:
  a[:k]=s
  a[k:]=s-1
elif k==0 and s>=1000000000:
  a[:]=s-1
else:
  a[:]=s+1
for s in a:
  print(s, end =" ")

Buggy submission (verdict: Runtime Error):
import numpy as np
n,k,s = map(int,input().split())
a=np.arange(n)
if k>0 & s<=1000000000:
  a[:k]=s
  a[k:]=s+1
elif k>0 & s=1000000000:
  a[:k]=s
  a[k:]=s-1
else:
  a[:]=s+1
for s in a:
  print(s, end =" ")
Problem p02705 (python)

Fixed submission:
from sys import stdin


def main():

    R = int(stdin.readline().rstrip())

    print(2*R*3.14)


if __name__ == "__main__":
    main()

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


def main():

    R = [int(x) for x in stdin.readline().rstrip().split()]

    print(R*R*3.14)


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

Fixed submission:
from sys import stdin

S, T = stdin.readline().rstrip().split()

print(T+S)

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

S, T = stdin.readline().rstrip().split()

print(T+S)
from sys import stdin

S, T = stdin.readline().rstrip().split()

print(T+S)
Problem p02922 (python)

Fixed submission:
from sys import stdin


def main():
    A, B = [int(x) for x in stdin.readline().rstrip().split()]
    ans = A
    sum_ = 1

    while True:
        if B == 1:
            sum_ = 0
            break

        if ans >= B:
            break

        sum_ += 1

        ans = ans - 1 + A

    print(sum_)


if __name__ == "__main__":
    main()

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


def main():
    A, B = [int(x) for x in stdin.readline().rstrip().split()]
    ans = A
    sum_ = 1

    while True:
        if ans >= B:
            break

        sum_ += 1

        ans = ans - 1 + A

    print(sum_)


if __name__ == "__main__":
    main()
from sys import stdin


def main():
    A, B = [int(x) for x in stdin.readline().rstrip().split()]
    ans = A
    sum_ = 1

    while True:
        if ans >= B:
            break

        sum_ += 1

        ans = ans - 1 + A

    print(sum_)


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

Fixed submission:
from sys import stdin


def main():
    N = int(input())
    H = [int(x) for x in stdin.readline().rstrip().split()]

    sum_ = set()
    count = 0

    if N == 1:
        print(0)
        return

    for i in range(N):
        if H[i] >= H[i+1]:
            count += 1
            sum_.add(count)
        else:
            sum_.add(count)
            count = 0
        if i == N-2:
            break

    print(max(sum_))


if __name__ == "__main__":
    main()

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


def main():
    N = int(input())
    H = [int(x) for x in stdin.readline().rstrip().split()]

    sum_ = set()
    count = 0

    for i in range(N):
        if H[i] >= H[i+1]:
            count += 1
            sum_.add(count)
        else:
            sum_.add(count)
            count = 0
        if i == N-2:
            break

    print(max(sum_))


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

Fixed submission:
from sys import stdin


def main():

    S = stdin.readline().rstrip()
    S_len = len(S)

    sum = 0
    s = S[0]
    x = 1

    while True:
        if len(s) == 1:
            if s == S[x]:
                s = s + S[x]
            else:
                sum += 1
                s = S[x]
        else:
            sum += 2
            x += 1

            if x >= S_len:
                break
            s = S[x]
        x += 1

        if x >= S_len:
            sum += 1
            break

    print(sum)


if __name__ == "__main__":
    main()

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


def main():

    S = stdin.readline().rstrip()
    S_len = len(S)

    sum = 0
    s = S[0]
    x = 1

    while True:
        if len(s) == 1:
            if s == S[x]:
                s = s + S[x]
            else:
                sum += 1
                s = S[x]
        else:
            sum += 2
            x += 1
            s = S[x]
        x += 1

        if x >= S_len:
            sum += 1
            break

    print(sum)


if __name__ == "__main__":
    main()

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


def main():

    S = stdin.readline().rstrip()
    S_len = len(S)

    sum = 0
    s = S[0]
    x = 1

    while True:
        if len(s) == 1:
            if s == S[x]:
                s = s + S[x]
            else:
                sum += 1
                s = S[x]
        else:
            sum += 2
            x += 1
            s = S[x]
        x += 1

        if x == S_len:
            sum += 1
            break

    print(sum)


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

Fixed submission:
from sys import stdin


def main():
    _ = int(input())
    a_lists = [int(x) for x in stdin.readline().rstrip().split()]
    z = 0

    for a in a_lists:
        z ^= a

    if z == 0:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

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


def main():
    N = int(input())
    a = [int(x) for x in stdin.readline().rstrip().split()]
    a_ = {int(x) for x in stdin.readline().rstrip().split()}
    count = 0


    for i in range(N):
        
        if  a[i-1] ^ a[i] in a_ :
            # a_.discard(a[i-1] ^ a[i])
        else:
            count += 1

    if count == 0:
        print("Yes")
    else:
        print("No")    


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

Fixed submission:
from sys import stdin


def main():
    n = int(input())

    p = [int(x) for x in stdin.readline().split()]
    count = 0

    for i in range(1 , n-1):
        if p[i-1] > p[i] >p[i+1] or p[i-1] < p[i] < p[i+1]:
            count +=1
    
    print(count)


if __name__ == "__main__":
    main()

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


def main():
    n = int(input())

    p = stdin.readline().split()
    count = 0

    for i in range(1 , n):
        if p[i-1] >= p[i] >=p[i+1] and  p[i-1] != p[i] or p[i-1] <= p[i] <=p[i+1] and p[i] !=p[i+1]:
            count +=1
    
    print(count)


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

Fixed submission:
from sys import stdin


def main():
    N, L = [int(x) for x in stdin.readline().rstrip().split()]

    apple_list = []

    for i in range(N):
        apple_list.append(L+i)

    s = sorted(apple_list, key=abs)
    s.pop(0)
    print(sum(s))


if __name__ == "__main__":
    main()

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


def main():
    N, L = [int(x) for x in stdin.readline().rstrip().split()]

    apple_list = []

    for i in range(N):
        apple_list.append(L+i)

    s = sorted(apple_list, key=abs)
    s.pop(0)
    print(sum(s))
    //print(123)


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

Fixed submission:
from sys import stdin


def main():
    A, B, T = [int(x) for x in stdin.readline().split()]

    print((T // A * B))


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):

def main():
    N = int(input())
    A = list(map(int, input().split()))
    A_reverse = list(reversed(A))
    left = [0]
    right = [0]
    answer = []
    for n in range(N):
        left.append(gcd(left[n], A[n]))
        right.append(gcd(right[n], A_reverse[n]))
    del left[N]
    del right[N]
    right.reverse()
    for n in range(N-1):
        answer.append(gcd(left[n], right[n]))
    print(max(answer))


def gcd(x, y):
    while y != 0:
        x, y = y, x % y
    return x


if __name__ == "__main__":
    main()