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

Fixed submission:
n,k=map(int,input().split())
p=list(map(int,input().split()))
s=[(i+1)/2 for i in p]
cans=sum(s[:k])
ans=cans
for i in range(n-k):
    cans=cans-s[i]+s[i+k]
    ans=max(ans,cans)
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
import copy
n,k=map(int,input().split())
p=list(map(int,input().split()))
p = np.array(p)
s = copy.deepcopy(p)
P = np.empty((k-1, n))
for i in range(k-1):
    P[i] = np.roll(p,(-i-1))
    s = s+P[i]
    s[-i-1] = 0
s.sort()
ans = (s[-1]/2)+0.5*k
print(ans)
Problem p02817 (python)

Fixed submission:
s,t=input().split()

print(t+s)

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

print(t+s)
Problem p02947 (python)

Fixed submission:
N = int(input())
S = [''.join(sorted(input().rstrip())) for _ in range(N)]
 
from collections import Counter
counter = Counter(S)
 
answer = sum(x*(x-1)//2 for x in counter.values())
print(answer)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = []
for _ in range(n):
    tmp = input()
    tmp.sort()
    s.append(tmp)
cnt = 0
for i in range(n-1):
    for j in range(1,n):
        if s[i]==s[j]:
            cnt+=1
print(cnt)

Buggy submission (verdict: Runtime Error):
n=int(input())
s = [input() for i in range(n)]
c=0
for i in range(n):
   b[i]=sorted(s[i])
   a[i]=''.join(b[i])
for i in range(n-1):
    for j in range(i+1,n):
        if a[i]==a[j]:
            c+=1
print(c)

Buggy submission (verdict: Runtime Error):
n=int(input())
s = [input() for i in range(n)]
c=0
for i in range(n):
   b[i]=sorted(s[i])
   a[i]=''.join(b[i])
for i in range(n-1):
    for j in range(i+1,n):
        if a[i]==a[j]:
            c+=1
print(c)

Buggy submission (verdict: Runtime Error):
n=int(input())
s = [input() for i in range(n)]
c=0
a=["" for i in range(n)]
for i in range(n):
   b[i]=sorted(s[i])
   a[i]=''.join(b[i])
for i in range(n-1):
    for j in range(i+1,n):
        if a[i]==a[j]:
            c+=1
print(c)

Buggy submission (verdict: Runtime Error):
n=int(input())
s = [input() for i in range(n)]
c=0
a=["" for i in range(n)]
for i in range(n):
   b[i]=sorted(s[i])
   a[i]=''.join(b[i])
   print(a)
for i in range(n-1):
    for j in range(i+1,n):
        if a[i]==a[j]:
            c+=1
print(c)

Buggy submission (verdict: Runtime Error):
n=int(input())
s = [input() for i in range(n)]
c=0
a=["" for i in range(n)]
for i in range(n):
   b[i]=sorted(s[i])
   a[i]=''.join(b[i])

for i in range(n-1):
    for j in range(i+1,n):
        if a[i]==a[j]:
            c+=1
print(c)

Buggy submission (verdict: Runtime Error):
n=int(input())
s = [input() for i in range(n)]
c=0
print(s)
for i in range(n):
   r[i]=(sorted([s[i][j] for j in range(10)]))
   r[i]=''.join(r[i])
for i in range(n-1):
    for j in range(i+1,n):
        if r[i]==r[j]:
            c+=1
print(c)

Buggy submission (verdict: Runtime Error):
n=int(input())
s = [input() for i in range(n)]
c=0
for i in range(n):
   r[i]=(((sorted([s[i][j] for j in range(10)]))))
   r[i]=''.join(r[i])
for i in range(n-1):
    for j in range(i+1,n):
        if r[i]==r[j]:
            c+=1
print(c)
Problem p03196 (python)

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

    if temp!=1:
        arr.append([temp, 1])

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

    return arr

a=factorization(p) 
ans=1
for i in range(len(a)):
    if n<=a[i][1]:
        while a[i][1]>=n:
            ans=ans*a[i][0]
            a[i][1]-=n      
print(ans)

Buggy submission (verdict: Runtime Error):
n,p = map(int,input().split())
import sympy
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

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

    return arr

tmp = factorization(p)
ans = 1
for i in range(len(tmp)):
    while tmp[i][1]>=n:
        tmp[i][1]-=n
        ans*=tmp[i][0]
print(ans)
Problem p02730 (python)

Fixed submission:
def is_palindrome(s):
    if len(s) > 1:
        i = 0
        n = len(s)-1
        while s[i] == s[n]:
            i += 1
            n -= 1
            if i >= n:
                break
        else:
            return False
        return True
    else:
        return True

s = input()
n = len(s)

if is_palindrome(s) and is_palindrome(s[0:(n-1)//2]) and is_palindrome(s[(n+3)//2-1:]):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
def is_palindrome(s):
    i = 0
    n = len(s)-1
    while s[i] == s[n]:
        i += 1
        n -= 1
        if i >= n:
            break
    else:
        return False
    return True

s = input()
n = len(s)

if is_palindrome(s) and is_palindrome(s[0:(n-1)//2-1]) and is_palindrome(s[(n+3)//2-1:]):
    print("Yes")
else:
    print("No")
Problem p02732 (python)

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

c = {}

for i in a:
    c[i] = c.get(i, 0) + 1

ways = 0
for i in c:
    ways += c[i]*(c[i]-1)//2

for k in a:
    ans = ways-c[k]+1
    print(ans)

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

b = set(a)

c = {}

for i in a:
    c[i] = c.get(i, 0) + 1

e = {}
for i in a:
    e[i] = c[i]*(c[i]-1)//2

for k in a:
    if d.get(k, "hello") == "hello":
        ans = 0
        for i in b:
            if i != k:
                ans += e[i]
            else:
                ans += e[i]+1-c[i]
        d[k] = ans
    else:
        ans = d[k]
    print(ans)

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

b = set(a)

c = {}

for i in a:
    c[i] = c.get(i, 0) + 1

d = {}

for k in a:
    if d.get(k, "hello") == "hello":
        ans = 0
        for i in b:
            if i != k:
                ans += c[i]*(c[i]-1)//2
            else:
                ans += (c[i]-1)*(c[i]-2)//2
        d[k] = ans
    else:
        ans = d[ans]
    print(ans)
Problem p02767 (python)

Fixed submission:
def ans(p, x):
    a = 0
    for i in x:
        a += (i - p)**2
    return a

n = int(input())
x = list(map(int, input().split()))

p = sum(x)//n

print(min(ans(p, x), ans(p+1, x)))

Buggy submission (verdict: Runtime Error):
def ans(p, x):
    a = 0
    for i in x:
        a += (i - p)**2
    return a

n = int(input())
x = list(map(int, input().split()))

p = sum(x)//n

print(min(ans(p), ans(p+1)))
Problem p02802 (python)

Fixed submission:
# unihernandez22
# https://atcoder.jp/contests/abc151/tasks/abc151_c
# implementation

class Counter(dict):
    def __missing__(self, i):
        return 0

class BoolDict(dict):
    def __missing__(self, i):
        return False

n, m = map(int, input().split())

passed = 0
penalties = Counter()

ac = BoolDict()

for i in range(m):
    p, s = input().split()
    if not ac[p]:
        if s == "WA": penalties[p] += 1
        elif s == "AC":
            passed += 1
            ac[p] = True

x = 0
for i in penalties:
    if ac[i]:
        x += penalties[i]

print(passed, x)

Buggy submission (verdict: Runtime Error):
# unihernandez22
# https://atcoder.jp/contests/abc151/tasks/abc151_c
# implementation

class Counter(dict):
    def __missing__(self, i):
        return 0

n, m = map(int, input().split())

passed = 0
penalties = Counter()

ac = {}

for i in range(m):
    p, s = input().split()
    if not ac.get(p, False):
        if s == "WA": penalties[p] += 1
        elif s == "AC":
            passed += 1
            ac[p] = True

x = 0
for i in penalties:
    if ac[i]:
        x += penalties[i]

print(passed, x)
Problem p03829 (python)

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

ans = 0
for i in range(1, len(x)):
  ans += min(b, (x[i]-x[i-1])*a)

print(ans)

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

ans = 0
for i in range(1, len(x)):
  ans += min(b, (x[i]-x[i-1]+a-1)//a*a)

print(ans)

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

ans = 0
for i in range(1, x):
  ans += min(b, (x[i]-x[i-1]+a-1)//a*a)

print(ans)
Problem p02988 (python)

Fixed submission:
# Vicfred
# https://atcoder.jp/contests/abc132/tasks/abc132_b
# implementation
n = int(input())
p = list(map(int,input().split()))

answer = 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]:
        answer += 1

print(answer)

Buggy submission (verdict: Runtime Error):
# Vicfred
# https://atcoder.jp/contests/abc132/tasks/abc132_b
# implementation
n = int(input())
p = list(map(int,input()))

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

print(answer)
Problem p04043 (python)

Fixed submission:
# Vicfred
# https://atcoder.jp/contests/abc042/tasks/abc042_a
# implementation, sorting
ins = list(map(int, input().split()))
ins.sort()

if ins == [5, 5, 7]:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
# Vicfred
# https://atcoder.jp/contests/abc042/tasks/abc042_a
# sorting
import algorithm, strutils, sequtils

var line = stdin.readLine.split.map(parseInt)
line.sort
if line == [5, 5, 7]:
  echo "YES"
else:
  echo "NO"
Problem p02694 (python)

Fixed submission:
x = int(input())

ans = 0
money = 100
while money < x:
  money *= 1.01
  money = int(money)
  ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
x = int(input())
money = 100
year = 0

while money < x:
    money += money // 100;
    money = math.floor(money)
    year += 1
    
print(year)
Problem p02995 (python)

Fixed submission:
from fractions import gcd
a, b, c, d = map(int, input().split())
ans = b - a + 1

def lcm(x, y):
  return (x * y) // gcd(x, y)

a -= 1
ans = ans - (b//c) - (b//d) + (b//(lcm(c,d)))
ans = ans + (a//c) + (a//d) - (a//(lcm(c,d)))
print(ans)

Buggy submission (verdict: Runtime Error):
import math
a, b, c, d = map(int, input().split())
ans = b - a + 1

def lcm(x, y):
  return (x * y) // math.gcd(x, y)

a -= 1
ans = ans - (b//c) - (b//d) + (b//(lcm(c,d)))
ans = ans + (a//c) + (a//d) - (a//(lcm(c,d)))
print(ans)

Buggy submission (verdict: Runtime Error):
import math
a, b, c, d = map(int, input().split())
ans = b - a + 1

def lcm(x, y):
  return (x * y) // math.gcd(x, y)

a -= 1
ans = ans - b//c - b//d + b//(lcm(c,d))
ans = ans + a//c + a//d - a//(lcm(c,d))
print(ans)
Problem p02534 (python)

Fixed submission:
k = int(input())

for i in range(k):
	print("ACL" , end = "")

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

for (int i = 0; i++; i< k)
	print("ACL")
Problem p02909 (python)

Fixed submission:
s=input()
if s=="Sunny":
  print("Cloudy")
elif s=="Cloudy":
  print("Rainy")
else:
  print("Sunny")

Buggy submission (verdict: Runtime Error):
s=input()
if s=="Sunny":
  print("Cloudy")
elif s==Cloudy:
  print("Rainy")
else:
  print("Sunny")

Buggy submission (verdict: Runtime Error):
s=input()
if s==Sunny:
  print("Cloudy")
elif s==Cloudy:
  print("Rainy")
else:
  print("Sunny")
Problem p02910 (python)

Fixed submission:
s=input()
test=0
i=0
n=len(s)
if n%2==0:
   while  i<n:
      if s[i]=="L":
         test+=1
      if s[i+1]=="R":
         test+=1
      i+=2
else:
   while i+1<n:
      if s[i]=="L":
         test+=1
      if s[i+1]=="R":
         test+=1
      i+=2
   else:
      if s[i]=="L":
         test+=1
if test==0:
   print("Yes")
else:
   print("No")

Buggy submission (verdict: Runtime Error):
s=input()
test=0
i=0
n=len(s)
if n%2==0:
   while  i<n:
      if s[i]=="L":
         test+=1
      if s[i+1]=="R":
         test+=1
      i+=2
else:
   while i+1<n:
      if s[i]=="L":
         test+=1
      if s[i+1]=="R":
         test+=1
      i+=2
   else:
      if s[i+1]=="L":
         test+=1
if test==0:
   print("Yes")
else:
   print("No")

Buggy submission (verdict: Runtime Error):
s=input()
test=0
i=0
n=len(s)
if n%2==0:
   while  i<n:
      if s[i]=="L":
         test+=1
      if s[i+1]=="R":
         test+=1
      i+=2
else:
   while i+1<n:
      if s[i]=="L":
         test+=1
      if s[i+1]=="R":
         test+=1
      i+=2
   else:
      if s[i+1]="L":
         test+=1
if test==0:
   print("Yes")
else:
   print("No")
Problem p02927 (python)

Fixed submission:
m,d=map(int,input().split())
if 22>d:
    print(0)
else:
    a=22
    ans=0
    while d>=a:
        b=str(a)
        if 2>int(b[0]) or 2>int(b[1]):
            a+=1
        else:
            if m >= int(b[0])*int(b[1]):
                ans+=1
                a+=1
            else:
                a+=1
    print(ans)

Buggy submission (verdict: Runtime Error):
m,d=map(int,input().split())
if 22>d:
    print(0)
else:
    a=22
    ans=0
    while d>=a:
        b=str(a)
        if 2>int(b[0]) or 2>int(b[1]):
            a+=1
        else:
            if m >= int(b[0])*int(b[1]):
                ans+=1
                a+=1
            else:
                a+=1
print(ans)
Problem p02993 (python)

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

Buggy submission (verdict: Runtime Error):
s=input()
if s[0]==s[1] or s[1]==s[2] or s[2]==s[3] or s[3]==s[4]:
    print("bad")
else:
    print("good")

Buggy submission (verdict: Runtime Error):
s=input()
if s[0]==s[1] or s[1]==s[2] or s[2]==s[3] or s[3]==s[4]:
    print("good")
else:
    print("bad")

Buggy submission (verdict: Runtime Error):
s = list(input())
if s//1000==s//100-s//1000*10:
    print("good")
    if s//100-s//1000*10==s//10-s//100*10+s//1000*100:
        print("good")
        if s//10-s//100*10+s//1000*100==s-s//10*10+s//100*100-s//1000*1000:
print("bad")
Problem p02995 (python)

Fixed submission:
import fractions
a,b,c,d=map(int,input().split())

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

def amari(x,y):
    return x//y if x%y==0 else x//y+1

cnum=b//c-amari(a,c)+1
dnum=b//d-amari(a,d)+1
cdnum=b//lcm(c,d)-amari(a,lcm(c,d))+1

print(b-a+1-cnum-dnum+cdnum)

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

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

def amari(x,y):
    return x//y if x%y==0 else x//y+1

cnum=b//c-amari(a,c)+1
dnum=b//d-amari(a,d)+1
cdnum=b//lcm(c,d)-amari(a,lcm(c,d))+1

print(b-a+1-cnum-dnum+cdnum)

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

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

def amari(x,y):
    return x//y+1 if x%y!=0 else x//y

cnum=b//c-amari(a,c)+1
dnum=b//d-amari(a,d)+1
cdnum=b//lcm(c,d)-amari(a,lcm(c,d))+1

print(b-a+1-cnum-dnum+cdnum)
Problem p03059 (python)

Fixed submission:
a,b,t=map(int,input().split())
print((t//a)*b)

Buggy submission (verdict: Runtime Error):
a,b,t= map(int, input().split())
s=(10*t+5)//a
print(sb)
Problem p03076 (python)

Fixed submission:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
a1=a%10
b1=b%10
c1=c%10
d1=d%10
e1=e%10
ar=[a1,b1,c1,d1,e1]
a2=a//10
b2=b//10
c2=c//10
d2=d//10
e2=e//10
k=10
s=0
minimini=-1
for i in ar:
    if i==0:
        continue
    minimini=min(i,k)
    if i<k:
        k=i
for i in ar:
    if i==0:
        continue
    if i==minimini:
        minimini-=1
        continue
    else:
        s+=10
print((a2+b2+c2+d2+e2)*10+minimini+1+s)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
a1=a%10
b1=b%10
c1=c%10
d1=d%10
e1=e%10
ar=[a1,b1,c1,d1,e1]
a2=a//10
b2=b//10
c2=c//10
d2=d//10
e2=e//10
k=10
s=0
for i in ar:
    if i==0:
        s+=10
        continue
    minimini=min(i,k)
    if minimini==i:
        k=i
    else:
        s+=10
print((a2+b2+c2+d2+e2)*10+minimini+s)
Problem p03101 (python)

Fixed submission:
H, W=map(int, input().split())
h, w=map(int, input().split())
ans=(W-w)*(H-h)
print(ans)

Buggy submission (verdict: Runtime Error):
H, W=int(HW[0]),int(HW[1])
h, w=int(hw[0]),int(hw[1])
ans=(W-w)*(H-h)
print(ans)

Buggy submission (verdict: Runtime Error):
H, W=int(HW[0]),int(HW[1])
h, w=int(hw[0]),int(hw[1])
print((W-w)*(H-h))
Problem p03109 (python)

Fixed submission:
s=input()
if s[5]=="0":
    if int(s[6])>4:
        print('TBD')
    else:
        print('Heisei')
else:
    print('TBD')

Buggy submission (verdict: Runtime Error):
s=input()
if int(s[4:5])>4:
    print("TBD")
else:
    print("Heisei")
Problem p03139 (python)

Fixed submission:
n,a,b=map(int,input().split())
if a+b-n>0:
  ans=a+b-n
else:
  ans=0
print(min(a,b),ans,sep=' ')

Buggy submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
if a+b-n>0:
  ans=a+b-n
else:
  ans==0
print(min(a,b),ans,sep=' ')
Problem p03145 (python)

Fixed submission:
a,b,c=map(int, input().split())
ans=(a*b)//2
print(ans)

Buggy submission (verdict: Runtime Error):
|AB|,|BC|,|CA|=map(int, input().split())
ans=(|AB|*|BC|*|CA|/max(|AB|,|BC|,|CA|))/2
print(ans)
Problem p03192 (python)

Fixed submission:
s=input()
print(s.count('2'))

Buggy submission (verdict: Runtime Error):
s=input()
print(s.count(2))
Problem p03238 (python)

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

Buggy submission (verdict: Runtime Error):
n=int(input())
a=int(input())
b=int(input())
if n==1:
    print("Hello World")
elif n==2:
    ans=a+b
    print(ans)
Problem p03323 (python)

Fixed submission:
a,b =map(int, input().split())
if 9>a and 9>b:
    print("Yay!")
else:
    print(":(")

Buggy submission (verdict: Runtime Error):
a,b -map(int, input().split())
if 9>a and 9>b:
    print("Yay!")
else:
    print(":(")
Problem p03470 (python)

Fixed submission:
n=int(input())
s = []
for _ in range(n):
    s.append(input()) 
print(len(list(set(s))))

Buggy submission (verdict: Runtime Error):
N, *d = map(int, open(0).read().split())
c=list(set(*d))
print(len(c))
Problem p03485 (python)

Fixed submission:
a,b=map(int,input().split())
import math
print(math.ceil((a+b)/2))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
print(math.floor((a+b)/2))
Problem p03587 (python)

Fixed submission:
s=input()
ans=0
for _ in range(6):
  if s[_]=='1':
    ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
s=input()
ans=0
for_ in range(6):
  if s[_]=='1':
    ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
s=input()
ans=0
for_ in range(6):
  if s[_]==1:
    ans+=1
print(ans)
Problem p03679 (python)

Fixed submission:
x,a,b=map(int,input().split())
if 0>=b-a:
  print('delicious')
elif x>=b-a and b-a>0:
  print('safe')
else:
  print('dangerous')

Buggy submission (verdict: Runtime Error):
x,a,b=map(int,input().split())
if b-a=<0:
  print('delicious')
elif b-a=<x and not b-a=<0:
  print('safe')
else:
  print('dangerous')

Buggy submission (verdict: Runtime Error):
x,a,b=map(int,input().split())
if -a+b=<0:
  print('delicious')
elif -a+b=<x and not -a+b=<0:
  print('safe')
else:
  print('dangerous')
Problem p03695 (python)

Fixed submission:
n=int(input())
r=list(map(int,input().split()))
rlist=[]
def color(n):
    if n<400:
        return 1
    elif n<800:
        return 2
    elif n<1200:
        return 3
    elif n<1600:
        return 4
    elif n<2000:
        return 5 
    elif n<2400:
        return 6 
    elif n<2800:
        return 7 
    elif n<3200:
        return 8 
    else:
        return 9

for _ in range(n):
    co=color(r[_])
    rlist.append(co)

ans1=len(set(rlist))

if rlist.count(9)==0:
    print(ans1,ans1,sep=" ")

else:    
    if ans1==1:
        print(1,rlist.count(9),sep=" ")

    else:
        print(ans1-1,ans1-1+rlist.count(9),sep=" ")

Buggy submission (verdict: Runtime Error):
n=int(input())
r=list(map(int,input().split()))
rlist=[]
def color(n):
    if n<400:
        return 1
    elif n<800:
        return 2
    elif n<1200:
        return 3
    elif n<1600:
        return 4
    elif n<2000:
        return 5 
    elif n<2400:
        return 6 
    elif n<2800:
        return 7 
    elif n<3200:
        return 8 
    else:
        return 9

for _ in range(n):
    co=color(r[_])
    rlist.append(co)

ans1=len(set(rlist))
if rlist.count(9)==0:
    print(ans1,ans1,sep=" ")

elif ans1==1:
    print(1,min(8,rlist.count(9),sep=" ")

else:
    print(min(8,ans1-1),min(8,ans1-1+rlist.count(9)),sep=" ")

Buggy submission (verdict: Runtime Error):
n=int(input())
r=list(map(int,input().split()))
rlist=[]
def color(n):
    if n<400:
        return 1
    elif n<800:
        return 2
    elif n<1200:
        return 3
    elif n<1600:
        return 4
    elif n<2000:
        return 5 
    elif n<2400:
        return 6 
    elif n<2800:
        return 7 
    elif n<3200:
        return 8 
    else:
        return 9

for _ in range(n):
    co=color(r[_])
    rlist.append(co)

ans1=len(set(rlist))
if rlist.count(9)==0:
    print(ans1,ans1,sep=" ")

elif ans1=1:
    print(1,min(8,rlist.count(9),sep=" ")

else:
    print(min(8,ans1-1),min(8,ans1-1+rlist.count(9)),sep=" ")
Problem p03844 (python)

Fixed submission:
a,op,b=input().split()
if op=="+":
   print(int(a)+int(b))
else:
   print(int(a)-int(b))

Buggy submission (verdict: Runtime Error):
a,op,b=map(input().split())
if op=="+":
   print(int(a)+int(b))
else:
   print(int(a)-int(b))
Problem p03852 (python)

Fixed submission:
c=input()
if c=="a"  or c=="i" or c=="u" or c=="e" or c=="o":
   print("vowel")
else:
   print("consonant")

Buggy submission (verdict: Runtime Error):
c=input()
if c="a"  or c="i" or c="u" or c="e" or c="o":
   print("vowel")
else:
   print("consonant")
Problem p04012 (python)

Fixed submission:
w=input()
c=0
if len(w)%2==1:
   print('No')
else:
   import string
   for _ in string.ascii_lowercase:
      if not w.count(_)%2==0:
         c+=1
   if c==0:
      print('Yes')
   else:
      print('No')

Buggy submission (verdict: Runtime Error):
w=input()
if len(w)%2==1:
   print('No')
else:
   c=0
   import string
   for _ in string.ascii_lowercase:
      if not w.count(_)%2==0:
         c+=1
if c==0:
   print('Yes')
else:
   print('No')
Problem p02573 (python)

Fixed submission:
n, m = map(int, input().split())
grid = [set() for i in range(n)]
for i in range(m):
    u, v = map(int, input().split())
    u -= 1
    v -= 1
    grid[u].add(v)
    grid[v].add(u)

cnt = 0
best = 0
visited = set()

import sys
sys.setrecursionlimit(1000000)

def dfs(x):
    global cnt
    if x in visited:
        return
    cnt += 1
    visited.add(x)
    for i in grid[x]:
        dfs(i)


for i in range(n):
    cnt = 0
    dfs(i)
    best = max(best, cnt)

print(best)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
grid = [set() for i in range(n)]
for i in range(m):
    u, v = map(int, input().split())
    u -= 1
    v -= 1
    grid[u].add(v)
    grid[v].add(u)

cnt = 0
best = 0
visited = set()


def dfs(x):
    global cnt
    if x in visited:
        return
    cnt += 1
    visited.add(x)
    for i in grid[x]:
        dfs(i)


for i in range(n):
    cnt = 0
    dfs(i)
    best = max(best, cnt)

print(best)