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

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

ans = []
for i in range(len(s)):
    if K >= ord('z')-ord(s[i])+1 and s[i] != 'a':
        K -= ord('z')-ord(s[i])+1
        ans.append('a')
    else:
        ans.append(s[i])

if K >= 1:
    ans[-1] = chr(ord(ans[-1])+K % 26)

print(''.join(ans))

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

ans = []
for i in range(len(s)):
    if K >= ord('z')-ord(s[i])+1:
        K -= ord('z')-ord(s[i])+1
        ans.append('a')
    else:
        ans.append(s[i])

if K >= 1:
    if len(ans) >= 1:
        ans[-1] = chr(ord(ans[-1])+K)
    else:
        print(chr(ord(s[0])+K))
        exit()

print(''.join(ans))

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

ans = []
for i in range(len(s)):
    if K >= ord('z')-ord(s[i])+1:
        K -= ord('z')-ord(s[i])+1
        ans.append('a')
    else:
        ans.append(s[i])

if K >= 1:
    if len(ans) >= 1:
        ans[-1] = chr(ord(ans[-1])+K)
    else:
        ans[0] = chr(ord(s[0])+K)

print(''.join(ans))

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

ans = []
for i in range(len(s)):
    if K >= ord('z')-ord(s[i])+1:
        K -= ord('z')-ord(s[i])+1
        ans.append('a')
    else:
        ans.append(s[i])

if K >= 1 and len(ans) >= 1:
    ans[-1] = chr(ord(ans[-1])+K)
else:
    ans[0] = chr(ord(s[0])+K)

print(''.join(ans))

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

ans = []
for i in range(len(s)):
    if K >= ord('z')-ord(s[i])+1:
        K -= ord('z')-ord(s[i])+1
        ans.append('a')
    else:
        ans.append(s[i])

if K >= 1:
    ans[-1] = chr(ord(ans[-1])+K)

print(''.join(ans))

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

ans = ''
for i in range(len(s)):
    if K >= ord('z')-ord(s[i])+1:
        K -= ord('z')-ord(s[i])+1
        ans += 'a'
    else:
        ans += s[i]

if K >= 1:
    ans = ans[:len(s)-1]+chr(ord(ans[-1])+K)

print(ans)

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

ans = ''
for i in range(len(s)):
    if K >= ord('z')-ord(s[i])+1:
        K -= ord('z')-ord(s[i])+1
        ans += 'a'
    else:
        ans += s[i]

if K >= 1:
    ans = ans[:-1]+chr(ord(ans[-1])+K)

print(ans)
Problem p03998 (python)

Fixed submission:
SA=input()
SB=input()
SC=input()

A_rest=len(SA)
B_rest=len(SB)
C_rest=len(SC)
next='a'

while(1):
    if next=='a':
       	if A_rest==0:
            print('A')
            exit()
        next=SA[len(SA)-A_rest]
        A_rest-=1
    elif next=='b':
       	if B_rest==0:
            print('B')
            exit()
        next=SB[len(SB)-B_rest]
        B_rest-=1
    else:
       	if C_rest==0:
            print('C')
            exit()
        next=SC[len(SC)-C_rest]
        C_rest-=1

Buggy submission (verdict: Runtime Error):
SA=input()
SB=input()
SC=input()

A_rest=len(SA)
B_rest=len(SA)
C_rest=len(SA)
next='a'

while(1):
    if next=='a':
        A_rest-=1
       	if A_rest<0:
           	break
        next=SA[len(SA)-A_rest]
    elif next=='b':
        B_rest-=1
       	if B_rest<0:
           	break
        next=SB[len(SB)-B_rest]
    else:
        C_rest-=1
       	if C_rest<0:
           	break
        next=SC[len(SC)-C_rest]

if A_rest<0:
    print('A')
elif B_rest<0:
    print('B')
else:
    print('C')
Problem p04012 (python)

Fixed submission:
w=sorted(input())
if len(w)%2==1:
    print('No')
else:
    while len(w)>=2:
        if w.pop(0)!=w.pop(0):
            print('No')
            exit()
    print('Yes')

Buggy submission (verdict: Runtime Error):
w=sorted(input())
if len(w)%2==1:
    print('No')
else:
    while len(w)>=2:
        if w.pop(0)!=w.pop(0):
            print('No')
            exit()
	print('Yes')
Problem p04026 (python)

Fixed submission:
s = input()

if len(s) == 2 and s[0] == s[1]:
    print(1, 2)
    exit()

for i in range(len(s)-2):
    if len(set(s[i:i+3])) != 3:
        print(i+1, i+3)
        exit()
print(-1, -1)

Buggy submission (verdict: Runtime Error):
s = input()
if s[-2] == s[-1]:
    print(len(s)-1, len(s))
    exit()

for i in range(s-2):
    if s[i] == s[i+1] or s[i] == s[i+2]:
        print(i+1, i+3)
        exit()
print(-1 - 1)
Problem p02608 (python)

Fixed submission:
import sys
import math
import itertools
import random
n=int(input())
lis=[0]*(10**8)
for a in range(1,int((math.sqrt(n)/2)+100)):
    for b in range(1,int((math.sqrt(n)/2)+100)):
        for c in range(1,int((math.sqrt(n)/2)+100)):
            lis[int(a**2+b**2+c**2+a*b+b*c+c*a)]+=1
for i in range(1,n+1):
    print(lis[i])

Buggy submission (verdict: Runtime Error):
import sys
import math
import itertools
import random
n=int(input())
lis=[0]*(10**9)
for a in range(1,int((math.sqrt(n)/2)+100)):
    for b in range(1,int((math.sqrt(n)/2)+100)):
        for c in range(1,int((math.sqrt(n)/2)+100)):
            lis[int(a**2+b**2+c**2+a*b+b*c+c*a)]+=1
for i in range(1,n+1):
    print(lis[i])

Buggy submission (verdict: Runtime Error):
import sys
import math
import itertools
import random
n=int(input())
lis=[0]*(10**5)
for a in range(1,int((math.sqrt(n)/2)+100)):
    for b in range(1,int((math.sqrt(n)/2)+100)):
        for c in range(1,int((math.sqrt(n)/2)+100)):
            lis[int(a**2+b**2+c**2+a*b+b*c+c*a)]+=1
for i in range(1,n+1):
    print(lis[i])

Buggy submission (verdict: Runtime Error):
import sys
import math
import itertools
import random
n=int(input())
lis=[0]*(10**5)
for a in range(1,int((math.sqrt(n)/2)+100)):
    for b in range(1,int((math.sqrt(n)/2)+100)):
        for c in range(1,int((math.sqrt(n)/2)+100)):
            lis[int(a**2+b**2+c**2+a*b+b*c+c*a)]+=1
for i in range(n):
    print(lis[i])
Problem p02621 (python)

Fixed submission:
import sys

import math
import itertools

a=int(input())
print(a+a**2+a**3)

Buggy submission (verdict: Runtime Error):
import sys

import math
import itertools

n,m,k=map(int,input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = 0
time = 0
max=len(a)+len(b)
for i in range(max):
    if (len(a) == 0):
        if (time + b[0] <= k):
            time += b[0]
            ans += 1
            b.pop(0)
    elif (len(b) == 0):
        if (time + a[0] <= k):
            time += a[0]
            ans += 1
            a.pop(0)
    else:
        tmp = 0
        isA=True
        if (a[0] < b[0]):
            tmp = a[0]
            isA=True
        else:
            tmp = b[0]
            isA = False
        if (time + tmp <= k):
            time += tmp
            ans += 1
            if (isA):
                a.pop(0)
            else:
                b.pop(0)
print(ans)
Problem p02663 (python)

Fixed submission:
import sys
import math
import itertools
h1, m1, h2, m2, k = map(int, input().split())
print(max((h2-h1)*60 + (m2-m1)-k,0))

Buggy submission (verdict: Runtime Error):
import sys
import math
import itertools
h1, m1, h2, m2, k = map(int, input().split())
print(max((h2-h1)*60 + (m2-m1)-k),0)
Problem p02664 (python)

Fixed submission:
import sys
import math
import itertools
s = input()
ans=''
for i in range(len(s)):
    if(s[i]=='?'):
        ans+='D'
    else:
        ans += s[i]
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
import math
import itertools
s = input()
ans=''
for i in range(len(s)):
    if (s[i] == '?'):
        if (i!=len(s)-1 and s[i + 1] == 'D' or s[i+1]=='?'):
            ans += 'P'
        else:
            ans+='D'
    else:
        ans += s[i]
print(ans)
Problem p02687 (python)

Fixed submission:
import sys
import math
s=input()
if (s == 'ABC'):
    print('ARC')
else:
    print('ABC')

Buggy submission (verdict: Runtime Error):
import sys
import math

n, m = map(int, input().split())
h = list(map(int, input().split()))
ma = [0] * n
for i in range(m):
    a, b = map(int, input().split())
    ma[a - 1] = max(h[a - 1],max(ma[a-1],h[b - 1]))
    ma[b - 1] = max(h[b - 1],max(ma[b-1] ,h[a - 1]))
cnt = 0
for i in range(n):
    if h[i] >= ma[i]:
        cnt += 1
print(cnt)
Problem p02761 (python)

Fixed submission:
import sys
n, m = map(int, input().split())
isExist = True
isExist2=True
li2 = [[''] for i in range(n)]
for i in range(m):
    s, c = map(int, input().split())
    if (li2[s - 1][0] != '' and li2[s - 1][0] != c):
        isExist = False
    elif(s == 1 and c == 0):
            isExist2 = False
    else:
        li2[s - 1][0] = c
ans=''
if (not isExist):
        print(-1)
        sys.exit()
if (not isExist2):
    if (n == 1):
        print(0)
        sys.exit()
    else:
        print(-1)
        sys.exit()
for i in range(n):
    if (li2[0][0] == ''):
        li2[0][0]=1
    if (li2[i][0] == ''):
        li2[i][0] = 0
for i in range(n):
    ans += str(li2[i][0])
if (n == 1 and m == 0):
    ans=0
print(int(ans))

Buggy submission (verdict: Runtime Error):
import sys
n, m = map(int, input().split())
isExist=True
li2 = [[''] for i in range(n)]
for i in range(m):
    s, c = map(int, input().split())
    if (li2[s - 1][0] != '' and li2[s - 1][0] != c):
        isExist = False
    elif(s == 1 and c == 0):
            isExist = False
    else:
        li2[s - 1][0] = c
ans=''
if (not isExist):
        print(-1)
        sys.exit()
    else:
        print(0)
        sys.exit()
for i in range(n):
    if (li2[0][0] == ''):
        li2[0][0]=1
    if (li2[i][0] == ''):
        li2[i][0] = 0
for i in range(n):
    ans += str(li2[i][0])
if (n == 1 and m == 0):
    ans=0
print(int(ans))

Buggy submission (verdict: Runtime Error):
import sys
n, m = map(int, input().split())
isExist=True
li2 = [[''] for i in range(m)]
for i in range(m):
    s, c = map(int, input().split())
    if (li2[s - 1][0] != '' and li2[s - 1][0] != c):
        isExist = False
    elif(s == 1 and c == 0):
            isExist = False
    else:
        li2[s - 1][0] = c
ans=''
if (not isExist):
    print(-1)
    sys.exit()
for i in range(m):
    if (li2[i][0] == ''):
        li2[i][0]=0
    ans += str(li2[i][0])
if (ans == ''):
    ans += '1'
    for i in range(n-1):
        ans+='0'
    print(int(ans))
else:
    print(int(ans))

Buggy submission (verdict: Runtime Error):
import sys
n, m = map(int, input().split())
isExist=True
li2 = [[''] for i in range(m)]
for i in range(m):
    s, c = map(int, input().split())
    if (li2[s - 1][0] != '' and li2[s - 1][0] != c):
        isExist = False
    elif(s == 1 and c == 0):
            isExist = False
    else:
        li2[s - 1][0] = c
ans=''
if (not isExist):
    print(-1)
    sys.exit()
for i in range(m):
    if (li2[i][0] == ''):
        li2[i][0]=0
    ans += str(li2[i][0])
print(int(ans))
Problem p02947 (python)

Fixed submission:
import math
def String_Sort(str):
    tmp = sorted(str)
    ans = ""
    for i in tmp:
        ans += i
    return ans

def sol(n):
    return (n*(n-1))//2

# main
li = []
n = int(input())
ans = 0
for i in range(n):
    li.append(String_Sort(input()))
li.sort()
# temporary
str = li[0]
num = 0
for i in li:
    if (i == str):
        num += 1
        continue
    else:
        if num>1:
            ans += sol(num)
        num = 1
        str = i
if (num > 1):
    ans+=sol(num)
print(ans)

Buggy submission (verdict: Runtime Error):
import math
def String_Sort(str):
    tmp = sorted(str)
    ans = ""
    for i in tmp:
        ans += i
    return ans

def sol(n):
    return math.factorial(n) / 2

# main
li = []
n = int(input())
ans = 0
for i in range(n):
    li.append(String_Sort(input()))
li.sort()
# temporary
str = li[0]
num = 0
for i in li:
    if (i == str):
        num += 1
        continue
    else:
        if num>1:
            ans += sol(num)
        num = 1
        str = i
if (num > 1):
    ans+=sol(num)
print(int(ans))
Problem p02957 (python)

Fixed submission:
a,b=map(int,input().split())
if  (a+b)%2==0:
    print((a+b)//2)
         
else:
    print('IMPOSSIBLE')

Buggy submission (verdict: Runtime Error):
int a=int(input())
int b=int(input())
if abs(a-b)%2==0:
  print(abs(a-b)/2)
else:
  print('IMPOSSIBLE')
Problem p03280 (python)

Fixed submission:
import sys
import math

a, b= map(int, input().split())
print(a*b-a-b+1)

Buggy submission (verdict: Runtime Error):
import sys
import math

s=input()
k = int(input())
cnt=0
for i in range(len(s)):
    if s[i] != '1':
        print(s[i])
        sys.exit()
if (cnt == 0):
    print('1')
Problem p03282 (python)

Fixed submission:
import sys
import math

s=input()
k = int(input())
cnt = False
ans=0
for i in range(0,k):
    if s[i] != '1':
        ans = s[i]
        cnt = True
        break
if (not cnt):
    print(1)
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
import sys
import math

s=input()
k = int(input())
cnt = False
ans=0
for i in range(0,k+1):
    if s[i] != '1':
        ans = s[i]
        cnt = True
        break
    cnt+=1
if (not cnt):
    print(1)
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
import sys
import math

s=input()
k = int(input())
cnt = False
ans=0
for i in range(len(s),k):
    if s[i] != '1':
        ans = s[i]
        cnt = True
        break
    cnt+=1
if (not cnt):
    print(1)
else:
    print(ans)
Problem p03351 (python)

Fixed submission:
import sys
import math
a, b, c, d = map(int, input().split())
if (max(a, c) - min(a, c) <= d or (max(a, b) - min(a, b) <= d and max(c, b) - min(c, b) <= d)):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import sys
x = int(input())
if (x == 1000):
    print(1000)
    sys.exit()
list = []
list.append(1)
for i in range(30):
    tmp = (i+2)**2
    while (tmp <= 1000):
        list.append(tmp)
        tmp = tmp*(i+2)
list.sort()
tmp = list[0]
for i in list:
    if (i > x):
        print(tmp)
        sys.exit()
    tmp = i
Problem p03633 (python)

Fixed submission:
def gcd(a, b):
    if (b == 0):
        return a
    return gcd(b,a%b)

def lcm(a, b):
    return (a * b) // gcd(a, b)


n = int(input())
ans = 1
for i in range(n):
    tmp = int(input())
    ans = lcm(ans, tmp)
print(ans)

Buggy submission (verdict: Runtime Error):
import math
def lcm(a, b):
    return (a*b)//math.gcd(a,b)
n = int(input())
ans = 1
for i in range(n):
    tmp = int(input())
    ans=lcm(ans,tmp)
print(ans)
Problem p02582 (python)

Fixed submission:
s=input()
count=0
sa=0
for char in s:
    if char=='R':
        sa+=1
    else:
        sa=0
    count=max(sa,count)
print(count)

Buggy submission (verdict: Runtime Error):
s=input()
count=0
flag=True
if s[0]=='R' and s[1]=='R' and s[2]=='R':
    print(3)
elif (s[0]=='R' and s[1]=='R') or (s[0]=='R' and s[2]=='R') 
or(s[1]=='R' and s[2]=='R'):
    print(2)
elif s[0]=='R' or s[1]=='R' or s[2]=='R':
    print(1)
else:
    print(0)
Problem p02718 (python)

Fixed submission:
import sys
def main():
  n, m = map(int, input().split())
  l = list(map(int, input().split()))
  d = sum(l) / (4 * m)
  cnt = 0;
  for li in l:
    if li >= d:
      cnt = cnt + 1
  if cnt >= m :
    print ("Yes")
  else :
    print ("No")
  return

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
  n, m = map(int, input().split())
  l = list(map(int, input().split()))
  d = sum(l) / 4 / m
  l.sort()
  for i in l:
    if l[i] < d:
      print ("No")
      return
  print ("Yes")
  return

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

Fixed submission:
x,n = [int(i) for i in input().split()]
if n == 0:
  print(x)
  exit()
p = [int(i) for i in input().split()]

num = list(range(102))
nums = []
for i in num:
  if not(i in p):
    nums.append(i)
#print(nums)
p2 = [abs(nums[i]-x) for i in range(len(nums))]
p2min = min(p2)
for i in range(len(p2)):
  if p2[i] == p2min:
    print(nums[i])
    exit()

Buggy submission (verdict: Runtime Error):
x,n = [int(i) for i in input().split()]
if n == 0:
  print(x)
  exit()
p = [int(i) for i in input().split()]

num = list(range(1,101))
nums = []
for i in num:
  if not(i in p):
    nums.append(i)
#print(nums)
p2 = [abs(nums[i]-x) for i in range(len(nums))]
p2min = min(p2)
for i in range(len(p2)):
  if p2[i] == p2min:
    print(nums[i])
    exit()
Problem p02730 (python)

Fixed submission:
s=input()
n=len(s)
if not(s==s[::-1]):
  print("No")
  exit()
if not(s[:(n-1)//2]==s[:(n-1)//2][::-1]):
  print("No") 
  exit()
if not(s[(n+3)//2-1:]==s[(n+3)//2-1:][::-1]):
  print("No")
  exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
s=input()
n=len(s)
if not(s==s[::-1]):
  print(No)
  exit()
if not(s[:1+(n-1)/2]==s[:1+(n-1)/2][::-1]):
  print(No) 
  exit()
if not(s[(n+3)/2:]==s[(n+3)/2:]):
  print(No)
  exit()
print(Yes)
Problem p02731 (python)

Fixed submission:
print((int(input())/3)**3)

Buggy submission (verdict: Runtime Error):
print((int(input())/3)**3
Problem p02765 (python)

Fixed submission:
n,r = input().split()
n = min(10,int(n))
r = int(r)
r = r+100*(10-n)
print(r)

Buggy submission (verdict: Runtime Error):
n,r = input()
n,r = input().split()
n = min(10,int(n))
r = int(r)
r = r+100*(10-n)
print(r)
Problem p02882 (python)

Fixed submission:
a,b,x = [int(x) for x in input().split()]
sq = x/a
sq2 = a*b - sq
if sq2 <= a*b/2:
  line = sq2*2/a+0.00000001
  import math 
  #print(sq,sq2,line)
  t = 90-math.degrees(math.atan(a/line))
  print(t)
else:
  line = sq*2/b+0.00000001
  import math 
  #print("a",sq,sq2,line)
  t = 90-math.degrees(math.atan(line/b))
  print(t)

Buggy submission (verdict: Runtime Error):
a,b,x = [int(x) for x in input().split()]
sq = x/a
sq2 = a*b - sq
if sq2 <= a*b/2:
  line = sq2*2/a
  import math 
  #print(sq,sq2,line)
  t = 90-math.degrees(math.atan(a/line))
  print(t)
else:
  line = sq*2/b
  import math 
  #print("a",sq,sq2,line)
  t = 90-math.degrees(math.atan(line/b))
  print(t)
Problem p02924 (python)

Fixed submission:
N = int(input())
print(sum(range(N)))

Buggy submission (verdict: Runtime Error):
N = int(input())
print(sum(list(range(N))))
Problem p02927 (python)

Fixed submission:
M, D = [int(x) for x in input().split()]
dates = list(range(22,D+1))
c = 0
 
for i in range(len(dates)):
  d1 = int(str(dates[i])[-1])
  d2 = int(str(dates[i])[-2])
  if d1*d2 <= M and d1 > 1 and d2 > 1:
    #print(d2,d1)
    c += 1
print(c)

Buggy submission (verdict: Runtime Error):
N, K = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
mod = 10**9+7
B = A*2
c = 0
for i in range(len(B)):
  t = B[i]
  for j in range(1,len(B[i:])):
    if t > B[i+j]:
      c += 1
      #print(t,B[i+j])
#print(c)
s = sum(range(K))
print((c%mod*s%mod)%mod)
Problem p02945 (python)

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

Buggy submission (verdict: Runtime Error):
A,B = map(int,input())
print(max(A*B,A-B,A+B))
Problem p02958 (python)

Fixed submission:
N = int(input())
p = [int(x) for x in input().split()]
a = sorted(p)

c = 0
for i in range(N):
  if p[i] != a[i]:
    c += 1
if c <= 2 :
  print("YES")
if c > 2:
  print("NO")

Buggy submission (verdict: Runtime Error):
N = int(input())
p = [int(x) for x in input().split()]
a = sorted(P)
c = 0
for i in range(N):
  if p[i] != a[i]:
    c+=1
if c <= 2 :
  print("YES")
if c >3:
  print("No")
Problem p02988 (python)

Fixed submission:
N = int(input())
nump = input().split()
nump = [int(i) for i in nump]

count = 0
for i in range(1,N-1):
  p = nump[i]
  tmp = nump[i-1:i+2]
  tmp.sort()
  if tmp[1] == p:
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
nump = input().split()
nump = [int(i) for i in nump]

count = 0
for i in range(1,8):
  p = nump[i]
  tmp = sorted([nump[i-1],nump[i],nump[i+1]])
  if tmp[1] == p:
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
nump = input().split()
nump = [int(i) for i in nump]

count = 0
for i in range(1,8):
  p = nump[i]
  tmp = sorted([p[i-1],p[i],[i+1]])
  if tmp[1] == p:
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
nump = input().split()
nump = [int(i) for i in nump]

count = 0
for i in range(1,8):
  p = p[i]
  tmp = sorted([p[i-1],p[i],[i+1]])
  if tmp[1] == p:
    count+=1
print(count)
Problem p02993 (python)

Fixed submission:
lock_num = input()
#lock_num = [int(x) for x in lock_num]
tag = 0
for i in range(3):
  if int(lock_num[i]) == int(lock_num[i+1]):
    tag = 1
    break
if tag == 0:
  print("Good")
else:
  print("Bad")

Buggy submission (verdict: Runtime Error):
lock_num = list(input())
#lock_num = [int(x) for x in lock_num]
tag = 0
for i in range(3):
  if int(lock_num[i]) == int(lock_num[i+1]):
    tag = 1
if tag == 0:
  print("Good")
else tag ==1:
  print("Bad")

Buggy submission (verdict: Runtime Error):
lock_num = input()
#lock_num = [int(x) for x in lock_num]
tag = 0
for i in range(len(lock_num)-1):
  if int(lock_num[i]) == int(lock_num[i+1]):
    tag = 1
if tag == 0:
  print("Good")
else tag ==1:
  print("Bad")

Buggy submission (verdict: Runtime Error):
lock_num = input().split()
lock_num = [int(x) for x in lock_num]
tag = 0
for i in range(len(lock_num)-1):
  if lock_num[i] == lock_num[i+1]:
    tag = 1
if tag == 0:
  print("Good")
else tag ==1:
  print("Bad")
Problem p02994 (python)

Fixed submission:
N, L = input().split()
N = int(N)
L = int(L)

apples = list(range(N)) 
apples = [x + L for x in apples]
abs_apples = [abs(x) for x in apples]
abs_min_index = abs_apples.index(min(abs_apples))

print(sum(apples) - apples[abs_min_index])

Buggy submission (verdict: Runtime Error):
N, L = input().split()
apples = [x + int(L) for x in list(range(int(N)))]
abs_min_index = [abs(x) for x in apples].index(min(abs_apples))
print(sum(apples) - apples[abs_min_index])

Buggy submission (verdict: Runtime Error):
N, L = input().split()
apples = [x + int(L) for x in list(range(int(N))]
abs_apples = [abs(x) for x in apples]
abs_min_index = abs_apples.index(min(abs_apples))
print(sum(apples) - apples[abs_min_index])

Buggy submission (verdict: Runtime Error):
N, L = input().split()
apples = [x + int(L) for x in list(range(int(N))
abs_apples = [abs(x) for x in apples]
abs_min_index = abs_apples.index(min(abs_apples))
print(sum(apples) - apples[abs_min_index])

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

apples = list(range(N)) + L
abs_min = min([abs(x) for x in apples])
print(sum[apples] - abs_min*2)
Problem p03001 (python)

Fixed submission:
W,H,x,y = input().split()
W =float(W)
H = float(H)
x = float(x)
y = float(y)
sq = W*H/2
if x == W/2 and y == H/2:
  print("{} 1".format(sq))
else:
  print("{} 0".format(sq))

Buggy submission (verdict: Runtime Error):
W,H,x,y = input().split()
W = int(W)
H = int(H)
x = int(x)
y = int(y)

print("{} 0".format(W*H/2)

Buggy submission (verdict: Runtime Error):
W,H,x,y = input().split()
W = int(W)
H = int(H)
x = int(x)
y = int(y)

print("{} 0".format(W*H/2)

Buggy submission (verdict: Runtime Error):
W,H,x,y = input().split()
W = int(W)
H = int(H)
x = int(x)
y = int(y)

if W/2 > x:
  sq1 = x * H
else:
  sq1 = (W-x) * H
  
if H/2 > y:
  sq2 = y * W
else:
  sq2 = (H-y) * W
if sq1 == sq2:
  print("{} 1".format(sq1))
elif sq1 > sq2:
  #print("{} 0".format(sq1))
#else:
 # print("{} 0".format(sq2))
Problem p02630 (python)

Fixed submission:
n = int(input())
a = input().split()
q = int(input())
d = dict()
s = 0
for num in a:
  if num in d:
    d[num] += 1
  else:
    d[num] = 1
  s += int(num)
for i in range(q):
  B, C = input().split()
  if B in d:
    if C in d:
      d[C] += d[B]
    else:
      d[C] = d[B]
    s += (int(C)-int(B))*d[B]
    d[B] = 0
  print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
q = int(input())
d = dict()
s = 0
for num in a:
  if num in d:
    d[num] += 1
  else:
    d[num] = 1
  s += num
for i in range(q):
  B, C = list(map(int, input().split()))
  if B in d:
    if C in d:
      d[C] += d[B]
    else:
      d[C] = d[B]
    s += (C-B)*d[B]
    s[B] = 0
  print(s)
Problem p02705 (python)

Fixed submission:
import math

r = int(input())

print(2*r*math.pi)

Buggy submission (verdict: Runtime Error):
import math

r = int(input())

print(r*2*math.PI)