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

Fixed submission:
n, d = map(int, input().split())
l = []
for i in range(n):
    l.append(list(map(int, input().split())))
count = 0
import math
for i in range(n):
    for j in range(i + 1, n):
        sum  = 0
        if i != j:
            for k in range(d):
                sum += (l[i][k] -l[j][k]) ** 2
            dis = math.sqrt(sum)
            if dis % 1 == 0:
                count += 1
print(count)

Buggy submission (verdict: Runtime Error):
n, d = map(int, input().split())
l = []
for i in range(n):
    l.append(list(map(int, input().split())))
count = 0
import math
for i in range(n):
    for j in range(n):
        sum  = 0
        for i in range(d):
            sum += (l[i][d] -l[i][d]) ** 2
        dis = sqrt(sum)
        if dis % 1 == 0:
            count += 1
print(count)
Problem p03037 (python)

Fixed submission:
n, m = map(int, input().split())
L = []
R = []
for i in range(m):
    l, r = map(int, input().split())
    L.append(l)
    R.append(r)
count = min(R) - max(L) + 1
if count <= 0:
    print(0)
else:
    print(count)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
l = []
for i in range(m):
    l, r = map(int, input().split())
    l.append(list(range(l, m + 1)))
c = [0] * n
for i in range(m):
    for j in range(n):
        if (j + 1) in l[i]:
            c[j] += 1
counr = 0
for i in c:
    if m == c[i]:
        count += 1
print(count)
Problem p03086 (python)

Fixed submission:
s = input()
l = list(s)

count = 0
clist = []
n = (len(l))
for i in range(n):
    if l[i] in 'ACGT':
        count += 1
        if i == n - 1:
            clist.append(count)
    else:
        clist.append(count)
        count = 0

print(max(clist))

Buggy submission (verdict: Runtime Error):
s = input()
l = list(s)

count = 0
clist = []
n = (len(l))
for i in range(n):
    if l[i] in 'ACGT':
        count += 1
    else:
        clist.append(count)
        count = 0
        
print(max(clist))
Problem p03126 (python)

Fixed submission:
n, m = map(int, input().split())
a = []
for i in range(n):
    a.append(list(map(int, input().split())))
l = [0] * m
for i in range(n):
    for j in range(m):
        if j + 1 in a[i][1:]:
            l[j] += 1
count = 0
for i in range(m):
    if l[i] == n:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = []
for i in range(n):
    a.append(list(map(int, input().split())))
l = [0] * m
for i in range(n):
    for j in range(m):
        if j + 1 in a[i][1:]:
            l[i] += 1
count = 0
for i in range(n):
    if l[i] == n:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = []
for i in range(n):
    a.append(list(map(int, input().split())))
l = [0] * m
for i in range(n):
    for j in range(m):
        if j + 1 in a[i][1:]:
            l[i] += 1
count = 0
print(l)
for i in range(n):
    if l[i] == n:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = []
for i in range(n):
    a.append(list(map(int, input().split())))
l = [0] * n
for i in range(m):
    for j in range(n):
        if i + 1 in a[j][1:]:
            l[i] += 1
count = 0
print(l)
for i in range(n):
    if l[i] == n:
        count += 1
print(count)
Problem p03238 (python)

Fixed submission:
n = int(input())
if n == 1:
    print('Hello World')
else:
    a = int(input())
    b = int(input())
    print(a + b)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = int(input())
b = int(input())
if n == 1:
    print('Hello World')
else:
    print(a + b)

Buggy submission (verdict: Runtime Error):
n = int(input())
a, b = map(int, input().split())
if n == 1:
    print('Hello World')
else:
    print(a + b)
Problem p03239 (python)

Fixed submission:
n, t = map(int, input().split())
a = [list(map(int, input().split())) for i in range(n)]
l = []
flag = False
for i in range(n):
    if a[i][1] <= t:
        l.append(a[i][0])
        flag = True
if flag:
    print(min(l))
else:
    print('TLE')

Buggy submission (verdict: Runtime Error):
n, t = map(int, input().split())
a = [list(map(int, input().split())) for i in range(n)]
l = []
flag = False
for i in range(n):
    if a[i][2] <= t:
        l.append(a[i][0])
        flag = True
if flag:
    print(min(l))
else:
    print('TLE')
Problem p03254 (python)

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

l = sorted(a)
flag = False
for i in range(n):
    x -= l[i]
    if x < 0:
        flag = True
        break
if flag:
    print(i)
elif x == 0:
    print(n)
elif x > 0:
    print(n - 1)

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

l = sorted(a)
flag = False
for i in range(n):
    x -= l[i]
    if x < 0:
        flag = True
        break
if flag:
    print(i)
elif x = 0:
    print(n)
elif x > 0:
    print(n - 1)
Problem p03261 (python)

Fixed submission:
n=int(input())
flag=True
a=0
l=[]
for i in range(n):
    b=a
    l.append(b)
    a=list(input())
    if i>0:
        if a[0]!=b[-1] or a in l:
            flag=False
if flag:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n=int(input)
flag=True
a=0
l=[]
for i in range(n):
    b=a
    l.append(b)
    a=list(input())
    if i>0:
        if a[0]!=b[-1] or a in l:
            flag=False
if flag:
    print('Yes')
else:
    print('No')
Problem p03289 (python)

Fixed submission:
S = list(input())
l = [chr(i) for i in range(65, 65+26)]

flag = True
count = 0
for i in range(len(S)):
    if i == 0:
        if S[i] != 'A':
            flag = False
            break
    if i == 1:
        if S[i] in l:
            flag = False
            break
    if 2 <= i <= len(S) - 2:
        if S[i] == 'C':
            count += 1
        elif S[i] in l:
            flag = False
            break
    if i == len(S) - 1:
        if S[i] in l:
            flag = False
            break
if not count == 1:
    flag = False

if flag:
    print('AC')
else:
    print('WA')

Buggy submission (verdict: Runtime Error):
S = list(input())
l = [chr(i) for i in range(65, 65+26)]

flag = True
if S[0] != 'A':
    flag = False
elif S[1] in l:
    flag = False
elif S[len(S)] in l:
    flag = False
elif not 'C' in S[2:len(S) - 2]:
    flag = False
count = 0
for i in range(2, len(S) - 1):
    if flag == False:
        break
    if S[i] in l:
        count += 1
    if count > 1:
        flag = False
if count < 1:
    flag = False
if flag:
    print('AC')
else:
    print('WA')
Problem p03386 (python)

Fixed submission:
a, b, k = map(int, input().split())
n = b - a + 1
if n <= k * 2:
    for i in range(a, b + 1):
        print(i)
else:
    for i in range(a, a + k):
        print(i)
    for j in range(b - k + 1, b + 1):
        print(j)

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input())
l = [i for i in range(a, b + 1)]
s = sorted(l)
if len(s) > k * 2:
    s = s[:k + 1] + s[k:]
print(s)
Problem p03416 (python)

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

count = 0
for i in range(a, b + 1):
    l = list(str(i))
    up = l[:(len(l) // 2)]
    if len(l) % 2 == 0:
        down = l[len(l) // 2:]
        down.reverse()
    else:
        down = l[(len(l) // 2) + 1:]
        down.reverse()
    if up == down:
        count += 1

print(count)

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

count = 0
for i in range(a, b + 1):
    l = list(i)
    up = l[:(len(l) // 2) - 1]
    if len(l) % 2 == 0:
        dowm = reverse(l[len(l) // 2:])
    else:
        dowm = reverse(l[(len(l) // 2) + 1:])
    if up == down:
        count += 1
print(count)
Problem p03474 (python)

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

flag1 = False
if s[a] == '-':
    flag1 = True

flag2 = False
if not '-' in s[:a - 1] and not '-' in s[a + 1:]:
    flag2 = True

if flag1 and flag2:
    print('Yes')
else:
    print('No')

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

flag1 = False
if s[a] == '-':
    flag1 = True

flag2 = False
if not '-' in s[:a - 1] and '-' in s[a + 1:]
    flag2 = True
  
if flag1 and flag2:
    print('Yes')
else:
    print('No')
Problem p03478 (python)

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

x = []
for j in range(1, m + 1):
    n = list(str(j))
    l = [int(n[i]) for i in range(len(n))]
    if len(l) == 1:
        l.append(0)
    s = sum(l)
    if a <= s and s <= b:
        x.append(j)
print(sum(x))

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

count = 0
for j in range(m):
    l = [n[i] for i in range(len(j))]
    sum = sum(l)
    if a <= sum and sum <= b:
        count += 1
print(count)

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

count = 0
for j in range(m):
    l = [n[i] for i in range(len(j))]
    sum = sum(l)
    if a <= sum and sum <= b:
        count += 1
print(count)

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

count = 0
for j in range(n):
    l = [n[i] for i in range(len(j))]
    sum = sum(l)
    if a <= sum and sum <= b:
        count += 1
print(count)

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

count = 0
for j in range(n):
    l = [n[i] for i in range(len(j))]
    sum = sum(l)
    if a <= sum and sum <= b:
        count += 1
print(count)

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

count = 0
for j in range(n)
    l = [n[i] for i in range(len(j))]
    sum = sum(l)
    if a <= sum and sum <= b:
        count += 1
print(count)

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

count = 0
for j in range(n):
    l = [n[i] for i in range(len(j))]
    sum = sum(l)
    if a <= sum and sum <= b:
        count += 1
print(count)

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

count = 0
for j in range(n)
    l = [n[i] for i in range(len(j))]
    sum = sum(l)
    if a <= sum and sum <= b:
        count += 1
print(count)
Problem p03497 (python)

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

a1 = sorted(a)
a2 = []
count = 1
for i in range(n - 1):
    if a1[i] == a1[i + 1]:
        count += 1
    else:
        a2.append(count)
        count = 1
a2.append(count)
l = sorted(a2)
print(sum(l[:len(l) - k]))

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

a1 = sorted(a)
a2 = []
count = 0
for i in range(n - 1):
    if a1[i] == a1[i + 1]:
        count += 1
    else:
        a2.append(count)
        break
a2.append(count)
l = sorted(a2)
print(sun(l[:len(l) - k - 1]))
Problem p03624 (python)

Fixed submission:
s = input()

l = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
flag = True
for i in l:
    if not i in s:
        print(i)
        flag = False
        break
if flag:
    print('None')

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

l = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h, 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for i in l:
    if not i in s:
        print(i)
        break

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

l = [a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z]
for i in l:
    if not i in s:
        print(i)
        break
Problem p03681 (python)

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

import math
if n == m:
    dog = math.factorial(n)
    mon = math.factorial(m)
    ans = dog * mon * 2
elif n == m + 1 or n == m - 1:
    dog = math.factorial(n)
    mon = math.factorial(m)
    ans = dog * mon
else:
    ans = 0

print(ans % (10 ** 9 + 7))

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

import math
if n == m:
    dog = math.factorial(n)
    mon = math.factorial(m)
    ans = dog * mon * 2
elif n == m + 1 or n == m - 1:
    dog = math.factorial(n)
    mon = math.factorial(m)
    ans = dog * mon
else:
    ans = 0

print(ans　// (10 ** 9 + 7))
Problem p03720 (python)

Fixed submission:
n, m = map(int, input().split())
count = [0] * n
for i in range(m):
    a = list(map(int, input().split()))
    for j in range(n):
        if j + 1 in a:
            count[j] += 1
for i in range(n):
    print(count[i])

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
count = [0] * n
for i in range(m):
    a = list(map(int, input().split()))
    for j in range(j):
        if j + 1 in a:
            count[j] += 1
for i in range(i):
    print(count[i])
Problem p03738 (python)

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

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

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

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

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

a = list(a)
b = list(b)

a = [int(a[i]) for i in range(len(a))]
b = [int(b[i]) for i in range(len(b))]

flag = True
if len(a) > len(b):
    print('GREATER')
    flag = False
elif len(b) > len(a):
    print('LESS')
    flag = False
else:
    for i in range(len(a)):
        if a[i] > b[i]:
            print('GREATER')
            flag = False
            break
        elif b[i] > a[i]:
            print('LESS')
            flag = False
            break
if flag:
    print('EQUAL')

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

a = list(a)
b = list(b)

flag = True
if len(a) > len(b):
    print('GREATER')
    flag = False
elif len(b) > len(a):
    print('LESS')
    flag = False
else:
    for i in range(len(a)):
        if a[i] > b[i]:
            print('GREATER')
            flag = False
            break
        elif b[i] > a[i]:
            print('LESS')
            flag = False
            break
if flag:
    print('EQUAL')
Problem p03971 (python)

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

all = list(s)
count = 0
count_b = 0
for i in all:
    if i == 'a':
        if count < a + b:
            print('Yes')
            count += 1
        else:
            print('No')
    elif i == 'b':
        if (count < a + b) and (count_b < b):
            print('Yes')
            count += 1
            count_b += 1
        else:
            print('No')
    else:
        print('No')

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

all = list(s)
count = 0
count_b = 0
for i in all:
    if i == 'a':
        if count <= a + b:
            print('yes')
            count += 1
        else:
            print('no')
    if i == 'b':
        if count <= a + b and count_b <= b
            print('yes')
            count += 1
            count_b += 1
        else:
            print('no')
    else:
        print('no')
Problem p02612 (python)

Fixed submission:
n=int(input())

x=n//1000
if n%1000==0:
  print(0)
else:
  print(1000-(n-1000*x))

Buggy submission (verdict: Runtime Error):
import numpy as np
h,w,k=map(int, input().split())
c=[list(input().split())  for i in  range(h)]
print(c)
Problem p02630 (python)

Fixed submission:
import numpy as np
from collections import Counter as C

n=int(input())
a = list(input().split())
a = [int(i) for i in a]
q=int(input())
bc=[list(map(int,input().split())) for i in range(q)]
bc=np.array(bc).T
b=bc[0]
c=bc[1]

d=C(a)
d2={}
for k,v in d.items():
  d2[k]=k*v

#print(d)
ans=sum(a)
for i in range(q):
  d[c[i]]+=d[b[i]]
  ans+=(c[i]-b[i])*d[b[i]]
  d[b[i]]=0
  print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
from collections import Counter as C

n=int(input())
a = list(input().split())
a = [int(i) for i in a]
q=int(input())
bc=[list(map(int,input().split())) for i in range(q)]
bc=np.array(bc).T
b=bc[0]
c=bc[1]

d=C(a)
d2={}
for k,v in d.items():
  d2[k]=k*v

#print(d)
ans=sum(d2.values())
for i in range(q):
  #print(d2)
  
  if d.get(b[i]):
    removed=d.pop(b[i])
    _=d2.pop(b[i])
    d[c[i]]+=removed
    d2[c[i]]=c[i]*d[c[i]]
  else:
    pass
  #print((np.array(list(d2.values()))))
  ans+=(c[i]-b[i])*removed
  print(ans)
Problem p02657 (python)

Fixed submission:
a, b = [int(i)  for i in input().split()]

print(a*b)

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

a = list(input().split())
a = [int(i) for i in a]
ans=1

if len(a) % 2 == 1: 
  for i in range(1, int(len(a)/2)+2):
    if ans > 10**18 or ans == 0:
      break
    if a[i-1] == 1:
      continue
    if i == int(len(a)/i) + 1:
      ans = ans*a[i-1]
    else:
      ans = ans*a[i-1]*a[-1*i]
    
else:
  for i in range(0, int(len(a)/2)):
    if ans > 10**18 or ans == 0:
      break
    if a[i-1] == 1:
      continue
    ans = ans*a[i]*a[-1 - i]
    

if ans > 10**18:
  print('-1')
else:
  print(ans)
Problem p02780 (python)

Fixed submission:
import numpy as np
n,k=map(int, input().split())
p=list(map(int,input().split()))


s=[]
p=np.array(p)
sum=0
for i in range(n):
  sum+=(1+p[i])/2
  s.append(sum)
#print(s)
if k==n:
  print(s[-1])
  exit()
max=s[k-1]-s[0]
for j in range(1,n-k):
  #print(j)
  if max<= s[j+k]-s[j]:
    max=s[j+k]-s[j]
  
print(max)

Buggy submission (verdict: Runtime Error):
import numpy as np
n,k=map(int, input().split())
p=list(map(int,input().split()))


s=[]
p=np.array(p)
sum=0
for i in range(n):
  sum+=(1+p[i])/2
  s.append(sum)
  
max=s[k]-s[0]
for j in range(1,n-k):
  #print(j)
  if max<= s[j+k]-s[j]:
    max=s[j+k]-s[j]
  
print(max)
Problem p03031 (python)

Fixed submission:
def add(s,d):
     sum=0
     for i in d[1:]:
          sum+=s[i] 
     return sum

def check(m):
    for i in range(m):
        if add(s, d[i]) % 2 == p[i]:
            pass
        else :
            return -1
    return 1
        
        
d = []
s=[]
inc=0

n, m = (int(x) for x in input().split())
for i in range(m):
    i = [int(i) for i in input().split()] 
    d.append(i)
p = [int(i) for i in input().split()]

r = 2 ** n

for i in range(r):
    x = str(bin(i).split('b')[1]).zfill(n + 1)
    s=list(x)
    s= [int(s) for s in s]
    if check(m) == 1:
            inc +=1
    
print(inc)

Buggy submission (verdict: Runtime Error):
def add(s,d):
     sum=0
     for i in d[1:]:
          sum+=s[i] 
     return sum

def check(m):
    for i in range(m):
        if add(s, d[i]) % 2 == p[i]:
            pass
        else :
            return -1
    return 1
        
        
d = []
s=[]
inc=0

n, m = (int(x) for x in input().split())
for i in range(m):
    i = [int(i) for i in input().split()] 
    d.append(i)
p = [int(i) for i in input().split()]


for i in range(32):
    x = '{:0>6}'.format(bin(i).split('b')[1])
    s=list(x)
    s= [int(s) for s in s]
    if check(m) == 1:
            inc +=1
    
print(inc)

Buggy submission (verdict: Runtime Error):
def add(s,d):
     sum=0
     for i in d[1:]:
          sum+=s[i] 
     return sum

def check(m):
    for i in range(m):
        if add(s, d[i]) % 2 == p[i]:
            pass
        else :
            return -1
    return 1
        
        
d = []
s=[]
inc=0

n, m = (int(x) for x in input().split())
for i in range(m):
    i = [int(i) for i in input().split()] 
    d.append(i)
p = [int(i) for i in input().split()]


for i in range(32):
    x = '{:0>6}'.format(bin(i).split('b')[1])
    s=list(x)
    s= [int(s) for s in s]
    #print(i, l)
    if check(m) == 1:
            inc +=1
    
print(inc)
Problem p03150 (python)

Fixed submission:
import copy
s=input()
check="keyence"
tmp=6
sNow=0
cNow=0
#一度目のチェック
for i in s:
  sNow+=1
  if i == check[cNow]:
    cNow+=1
  else:
    break
#最初に見つかれば終了
if cNow == 7:
  print("YES")
  exit()

#print(check[cNow:], s[-1*(7-cNow):])
"""
sの最後が"keyence"の残りの文字と一致すればOK
例：keyaence
最初の"key"は合っているので，残りは"aence"の内"a"を除いたもの
cNow=3, 7-cNow=4
後ろの４文字が"ence"ならばYESとなる
"""
if check[cNow:] == s[-1*(7-cNow):]:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
import copy
s=input()
check="keyence"
tmp=0
if check in s:
  print("YES")
  exit()
for i in s:
  if i == check[tmp]:
    tmp+=1
  else:
    break
tmp2=copy.copy(tmp)
for i in s[tmp:]:
  if i != check[tmp]:
    tmp2+=1
  else:
    break

if tmp2 == len(s):
  print("NO")
  exit()

for i in s[tmp2:]:
  if i == check[tmp]:
    tmp+=1
  else:
    print("NO")
    exit()
print("YES")
Problem p03427 (python)

Fixed submission:
n=input()

l=len(n)
if int(n)>9:
  ans=[9]
else:
  print(int(n))
  exit()
tmp=n[l-1]
for i in range(2,l+1):
  #print(tmp, int(n[l-i]))
  if int(tmp) != 9:
    tmp=int(n[l-i])-1
    #print("tmp:",tmp)
  else:
    tmp=int(n[l-i])
  if i==l:
    ans.append(int(tmp))
  else:
    ans.append(9)
  #print(ans)
print(sum(ans))

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

l=len(n)
if int(n)>9:
  ans=[9]
else:
  print(int(n))
  exit()
tmp=n[l-1]
for i in range(2,l+1):
  #print(tmp, int(n[l-i]))
  if int(tmp) != 9:
    tmp=int(n[l-i])-1
    #print("tmp:",tmp)
  if i==l:
    ans.append(tmp)
  else:
    ans.append(9)
  #print(ans)
print(sum(ans))
Problem p03471 (python)

Fixed submission:
def otoshi(n, y):
    x=0
    for i in range(n+1):
        x = i*10000
        if x >y :
            break
        for i2 in range(n+1 - i):
            x = i*10000 + i2 * 5000
            if x > y :
                break
                
            i3 = n - i - i2
            x =  i*10000 + i2 * 5000 + i3 *1000
            if x > y :
                break

            if i + i2 + i3 != n :
                pass
            else :
                if x  == y :
                    print(i, i2, i3)
                    return 

    print(-1, -1, -1)
    return 

n, y = [int(i)  for i in input().split()]

otoshi(n, y)

Buggy submission (verdict: Runtime Error):
def otoshi(n, y):
    x=0
    for i in range(n+1):
        x = i*1000
        if x >= y :
            break
        for i2 in range(n+1 - i):
            x = i*1000 + i2 * 5000
            if x >= y :
                break
            for i3 in range(n+1 - (i+i2)):
                x =  i*1000 + i2 * 5000 + i3 *10000
                if x > y :
                    break
                
                if i + i2 + i3 != n :
                    pass
                else :
                    if x  == y :
                        print(i3, i2, i1)
                        return 
    
    print(-1, -1, -1)
    return 

n, y = [int(i)  for i in input().split()]

otoshi(n, y)
Problem p03611 (python)

Fixed submission:
from collections import Counter as C

n  =  int(input())
a= list(input().split())
al = list([int(i) for i in a])
aset = set([int(i) for i in a])

cnt=0
ca = C(al)
#print(C(al)[0])
for i in aset:
  #print(i)
  #print(al.count(i-1),al.count(i),al.count(i+1))
  if cnt < ca[i-1] + ca[i] + ca[i+1]:
    cnt = ca[i-1] + ca[i] + ca[i+1]

print(cnt)

Buggy submission (verdict: Runtime Error):
n  =  int(input())
a= list(input().split())
al = list([int(i) for i in a])
aset = set([int(i) for i in a])

cnt=0

for i in aset:
  #print(i)
  #print(al.count(i-1),al.count(i),al.count(i+1))
  if cnt < al.count(i-1) + al.count(i) + al.count(i+1):
    cnt = al.count(i-1) + al.count(i) + al.count(i+1)
  if cnt >= len(al) / 2
  break
print(cnt)
Problem p03695 (python)

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

rate=[0]*9
over=0

for i in a:
  for j in range(1,9):
    if 400*(j-1) <= i < 400*j:
      rate[j]=1
      break
    elif i >= 3200:
      over+=1
      break

ansmin = rate.count(1)
ansmax = rate.count(1)
if ansmin == 0:
  ansmin=1

if over > 0:
  ansmax += over
    
#print(rate,over)
print(ansmin, ansmax)

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

rate=[0]*9
over=0

for i in a:
  for j in range(1,9):
    if 400*(j-1) <= i < 400*j:
      rate[j]=1
      break
    elif i >= 3200:
      over+=1
      break

ansmin = rate.counta(1)
ansmax = rate.count(1)
if ansmin == 0:
  ansmin=1

if over > 0:
  ansmax = ansmax + over
    
#print(rate,over)
print(ansmin, ansmax)