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

Fixed submission:
a, b, c = map(int, input().split())
if (b-c) * (c-a) > 0:
    print("Yes")
else:
    print("No")

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

black_start = s.find("#")
black_end = s.rfind("#")

white_start = s[black_start:].find(".")
white_end = s[black_start:].rfind(".")

black = s[black_start:].count("#")
white = s[black_start:].count(".")

if black == 0 or white ==0:
    print(0)
else:
    if white_end < black_end:
        print(black-1)
    else:
        print(min(black, white))
Problem p03069 (python)

Fixed submission:
n = int(input())
s = input()
black = s[:0].count("#")
white = s[0:].count(".")
count = [black+white]    
    
for i in range(1, n+1):
    if s[i-1]== "#":
        black +=1
    else:
        white -=1
    count.append(white+black)
    
print(min(count))

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

start = s.find("#")

white_start = s[start:].find(".")
white_end = s[start:].rfind(".")

black = s[start:].count("#")
white = s[start:].count(".")

if start == -1 or end==-1:
    print(0)
else:
    for i in range(white_start+1, white_end+1):
        if s[i] == "#":
            print(min(black, white))
            break
        elif i==white_end:
            print(1)

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

start = s.index("#")
black = s[start:].count("#")
white = s[start:].count(".")

print(min(black, white))

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

cand = [j for j in range(len(s)) if s[j] =="#" and s[j+1] !="#"]
count =0
if start == -1 or end == -1:
    print(0)
else:
    for i in cand:
        if s[i] == "#" and s[i+1] == ".":
            count +=1
    print(count)
Problem p03087 (python)

Fixed submission:
N, Q = map(int, input().split())
S = input()

t = [0] * (N)
for i in range(N-1):
    t[i+1] = t[i] + (1 if S[i:i+2]=="AC" else 0)

for j in range(Q):
    l, r = map(int, input().split())
    print(t[r-1] - t[l-1])

Buggy submission (verdict: Runtime Error):
n, q = map(int, input().split())
s = input()
for i in range(q):
    l, r = map(int, input().split())
    start_a = s[l-1:r].find('A')
    end_a = s[l-1:r].rfind('A')
    start_c = s[l-1:r].find("C")
    end_c = s[l-1:r].rfind("C")
    if start_a == end_a or start_a +1 == start_c:
        start = start_a
    elif start_a +1 < start_c:
        start = start_c +1
       
    if start_c == end_c or end_a +1 == end_c:
        end = end_c
    elif end_a +1 < end_c:
        end = end_a
        
    if start == -1 or end== -1 or end <= start:
        print(0)
        continue
    cand = s[l-1:r][start:end+1]
    print(cand.count("AC"))

Buggy submission (verdict: Runtime Error):
n, q = map(int, input().split())
s = input()
for i in range(q):
    l, r = map(int, input().split())
    start_a = s[l-1:r].find('A')
    end_a = s[l-1:r].rfind('A')
    start_c = s[l-1:r].find("C")
    end_c = s[l-1:r].rfind("C")
    if start_a == end_a or start_a +1 == start_c:
        start = start_a
    elif start_a +1 < start_c
        start = start_c +1
       
    if start_c == end_c or end_a +1 == end_c:
        end = end_c
    elif end_a +1 < end_c
        end = end_a
        
    if start == -1 or end== -1 or end <= start:
        print(0)
        continue
    cand = s[l-1:r][start:end+1]
    print(cand.count("AC"))

Buggy submission (verdict: Runtime Error):
n, q = map(int, input().split())
s = input()
for i in range(q):
    l, r = map(int, input().split())
    start = s[l-1:r].find('A')
    end = s[l-1:r].rfind("C")
     if start == -1 or end== -1:
        print(0)
        pass
    cand = s[l-1:r][start:end+1]
    print(cand.count("AC"))
Problem p03145 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c = input().split( )
area = int(a*b /2)
print(area)
Problem p02761 (python)

Fixed submission:
import sys
import math

N, M = map(int, input().split())

s, c = [0] * M, [0] * M
for i in range(M):
	s[i], c[i] = map(int, input().split())

for i in range(0 if N == 1 else 10 ** (N - 1), 10 ** N):
	x = str(i)
	if M == 0:
		print(i)
		sys.exit(0)
	for j in range(M):
		if x[s[j] - 1] != str(c[j]):
			break
		elif j == M - 1:
			print(i)
			sys.exit(0)

print(-1)

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

N, M = map(int, input().split())

s, c = [0] * N, [0] * N
for i in range(M):
	s[i], c[i] = map(int, input().split())

for i in range(0 if N == 1 else 10 ** (N - 1), 10 ** N):
	x = str(i)
	for j in range(M):
		if x[s[j] - 1] != str(c[j]):
			break
		elif j == M - 1:
			print(i)
			sys.exit(0)

print(-1)
Problem p02802 (python)

Fixed submission:
import sys

N, M = map(int, input().split())

WA = [0] * N
isAC = [False] * N

for _ in range(M):
	p, S = input().split()
	if S == "AC":
		isAC[int(p) - 1] = True
	elif not isAC[int(p) - 1]:
		WA[int(p) - 1] += 1

ACsum, WAsum = 0, 0
for i in range(N):
	if isAC[i]:
		ACsum += 1
		WAsum += WA[i]

print(ACsum, WAsum)

Buggy submission (verdict: Runtime Error):
import sys

N, M = map(int, input().split())

WA = [0] * N
isAC = [False] * N

for _ in range(M):
	p, S = input().split()
	if S == "AC":
		isAC[int(p) - 1] = True
	elif not isAC[int(p) - 1]:
		WA += 1

ACsum, WAsum = 0, 0
for i in range(N):
	if isAC[i]:
		ACsum += 1
		WAsum += WA[i]

print(ACsum, WAsum)
Problem p02814 (python)

Fixed submission:
import sys
import math
import fractions

N, M = map(int, input().split())
a = list(map(lambda x: int(x) >> 1, input().split()))
set(a)

fdigit = 0
while True:
	c = 1 << fdigit
	if a[0] & c != 0:
		break
	fdigit += 1

alcm = 1
for i in range(N):
	digit = 0
	while True:
		c = 1 << digit
		if a[i] & c != 0:
			break
		digit += 1
	if digit != fdigit:
		print(0)
		sys.exit(0)

	alcm = (alcm * a[i]) // fractions.gcd(alcm, a[i])

print(math.ceil((M // alcm) / 2))

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

N, M = map(int, input().split())
a = list(map(lambda x: int(x) >> 1, input().split()))

alcm = 1
for i in range(N):
	alcm = alcm * a[i] // math.gcd(alcm, a[i])

print(math.ceil((M // alcm) / 2))
Problem p02882 (python)

Fixed submission:
import math

a, b, x = map(int, input().split())

if x > (a ** 2) * b / 2:
	arg = (2 * b / a) - (2 * x / (a ** 3))
else:
	arg = (a * (b ** 2)) / (2 * x)

print(math.atan(arg) / math.pi * 180)

Buggy submission (verdict: Runtime Error):
import math

a, b, x = map(int, input().split())

if x > (a ** 2) * b / 2:
	arg = (2 * b / a) - (2 * x / (a ** 3))
elif x == (a ** 2) * b / 2:
	arg = atan2(b, a)
else:
	arg = (a * (b ** 2)) / (2 * x)

print(math.atan(arg) / math.pi * 180)
Problem p02947 (python)

Fixed submission:
import math

N = int(input())
s = [""] * N
for i in range(N):
	s[i] = list(input())
	s[i].sort()
s.sort()

st, count = 1, 0
for i in range(1, N):
	if s[i - 1] == s[i]:
		st += 1
	elif st > 1:
		count += math.factorial(st) // (2 * math.factorial(st - 2))
		st = 1
if st > 1:
	count += math.factorial(st) // (2 * math.factorial(st - 2))

print(count)

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
s = [""] * N
for i in range(N):
	s[i] = list(input())
	s[i].sort()
s.sort()

st, count = 1, 0
for i in range(1, N):
	if s[i - 1] == s[i]:
		st += 1
	elif st > 2:
		count += math.factorial(st) / (2 * (st - 2))
		st = 1
	elif st == 2:
		count += 1
		st = 1
if st > 2:
	count += math.factorial(st) / (2 * (st - 2))
elif st == 2:
	count += 1

print(int(count))
Problem p02606 (python)

Fixed submission:
a = a, b, c, = map(int, input().split())
bc = int(b/c)
ac = int((a-1)/c)
ans = bc-ac
print(ans)

Buggy submission (verdict: Runtime Error):
a = list(map(int, input().split()))
2
if a[0]<=100 and a[1]<=100 and a[2]<=100 and a[0]<=a[1]:
3
  b = a[1]-a[0]
4
  if b%a[2] > 0:
5
    print(int(b/a[2]))
6
    
7
  else:
8
    print(int(b/a[2])+1)
Problem p02658 (python)

Fixed submission:
def main(): 
  N = int(input())
  str_num = input().split()

  num_list = []
  for i in str_num:
    num_list.append(int(i))

  num_list.sort(reverse=True)

  ans = num_list[0]

  LIMIT_NUM = 10**18

  if 0 in num_list:
    print(0)
    return

  for i in range(1,N):
    ans *= num_list[i]
    if ans > LIMIT_NUM:
      print(-1)
      return

  print(ans)


main()

Buggy submission (verdict: Runtime Error):
str = input().split()
num_list = []
for i in str:
  num_list.append(int(i))

ans = num_list[0]
LIMIT_NUM = 10**18
for i in range(1,len(num_list):
  ans *= num_list[i]

if ans > LIMIT_NUM:
               print(-1)
else:
               print(ans)
Problem p02576 (python)

Fixed submission:
#abc176a
import math
n,x,t=map(int,input().split())
print(math.ceil(float(n)/x)*t)

Buggy submission (verdict: Runtime Error):
#abc176b
N=input()
s=0
for i in range(len(N)):
 s+=int(N[i])
if s%9==0:
 print('Yes')
else:
 print('No')
Problem p02582 (python)

Fixed submission:
#abc17a
s=input()
if 'RRR' in s:
 print(3)
elif 'RR' in s:
 print(2)
elif 'R' in s:
 print(1)
else:
 print(0)

Buggy submission (verdict: Runtime Error):
#abc175b
n=int(input())
l=list(map(int,input().split()))
l.sort()
cnt=0
for i in range(n):
 for j in range(i):
  for k in range(j):
   if l[k]!=l[j] and l[i]!=l[j] and l[k]+l[j]>l[i]:
    cnt+=1
print(cnt)
Problem p02705 (python)

Fixed submission:
#abc163a
from math import pi
r=int(input())
print(r*pi*2)

Buggy submission (verdict: Runtime Error):
#abc163c
n=int(input())
a=list(map(int,input().split()))
res=[0]*n
for x in a:
 res[x-1]+=1
print(*res,sep='\n')

Buggy submission (verdict: Runtime Error):
#abc163c
n=int(input())
a=list(map(int,input().split()))
for i in range(n):
 print(a.count(i+1))
Problem p02717 (python)

Fixed submission:
#abc161a
x,y,z=map(int,raw_input().split())
x,y=y,x
x,z=z,x
print x,y,z

Buggy submission (verdict: Runtime Error):
#abc161b
n,m=map(int,raw_input().split())
a=map(int,raw_input().split())
x=sum(a)/(4.0*m)
l=[i for i in a if i>=x]
if len(l)>=m:
 print 'Yes'
else:
 print 'No'

Buggy submission (verdict: Runtime Error):
abc161b
n,m=map(int,raw_input().split())
a=map(int,raw_input().split())
x=sum(a)/(4*m)
l=[i for i in a if i>x]
if len(l)>=m:
 print 'Yes'
else:
 print 'No'

Buggy submission (verdict: Runtime Error):
#abc161b
n,m=map(int,raw_input().split())
a=map(int,raw_input().split())
x=sum(a)/(4*m)
l=[i for i in a if i>=x]
if len(l)>m:
 print 'Yes'
else:
 print 'No'
Problem p02983 (python)

Fixed submission:
#abc133c

l,r=map(int,raw_input().split())
r=min(r,l+673)
res=2018
for i in  xrange(l,r+1):
 for j in xrange(i+1,r+1):
  res=min(res,i*j%2019)
print res

Buggy submission (verdict: Runtime Error):
#abc133c

l,r=map(int,raw_input().split())
if r-l>3000:
 print 0
 sys.exit()
res=-1
for i in xrange(l,r):
 for j in xrange(i+1,r+1):
  res=min(res,(i*j)%2019)
print res

Buggy submission (verdict: Runtime Error):
#abc133c

l,r=map(int,raw_input().split())
if r-l>3000:
 print 0
 sys.exit()
res=2018
for i in xrange(l,r):
 for j in xrange(i+1,r+1):
  res=min(res,(i*j)%2019)
print res
Problem p03059 (python)

Fixed submission:
#abc125a

a,b,t=map(int,raw_input().split())
res=t/a*b
print res

Buggy submission (verdict: Runtime Error):
#abc125b

n=int(raw_input())
v=map(int,raw_input().split())
c=map(int,raw_input().split())
res=0
for i in xrange(n):
 if v[i]-c[i]>0:
  res+=v[i]-c[i]
print res
Problem p03060 (python)

Fixed submission:
#abc125b

n=int(raw_input())
v=map(int,raw_input().split())
c=map(int,raw_input().split())
res=0
for i in xrange(n):
 if v[i]-c[i]>0:
  res+=v[i]-c[i]
print res

Buggy submission (verdict: Runtime Error):
abc125b

n=int(raw_input())
v=map(int,raw_input().split())
c=map(int,raw_input().split())
res=0
for i in xrange(n):
 if v[i]-c[i]>0:
  res+=v[i]-c[i]
print res
Problem p03085 (python)

Fixed submission:
#abc122a

b=raw_input()
if b=='A':
 print 'T'
elif b=='C':
 print 'G'
elif b=='G':
 print 'C'
else:
 print 'A'

Buggy submission (verdict: Runtime Error):
#abc122a

b=raw_input()
if b=='A':
 print 'T'
elif b=='C':
 print 'G'
elif b=='G':
 print 'C'
elif:
 print 'A'
Problem p03112 (python)

Fixed submission:
#abc119d
import bisect

a,b,q=map(int,raw_input().split())
inf=2<<60
s=[-inf]+[int(raw_input()) for i in xrange(a)]+[inf]
t=[-inf]+[int(raw_input()) for i in xrange(b)]+[inf]
s.sort()
t.sort()
for i in xrange(q):
 x=int(raw_input())
 b=bisect.bisect(s,x)
 d=bisect.bisect(t,x)
 res=inf
 for ss in [s[b-1],s[b]]:
  for tt in [t[d-1],t[d]]:
   d1=abs(ss-x)+abs(tt-ss)
   d2=abs(tt-x)+abs(ss-tt)
   res=min(res,d1,d2)
 print res

Buggy submission (verdict: Runtime Error):
abc119d
import bisect

a,b,q=map(int,raw_input().split())
inf=2<<60
s=[-inf]+[int(raw_input()) for i in xrange(a)]+[inf]
t=[-inf]+[int(raw_input()) for i in xrange(b)]+[inf]
for i in xrange(q):
 x=int(raw_input())
 b=bisect.bisect_right(s,x)
 d=bisect.bisect_right(t,x)
 res=inf
 for ss in [s[b-1],s[b]]:
  for tt in [t[d-1],t[d]]:
   d1=abs(ss-x)+abs(tt-ss)
   d2=abs(tt-x)+abs(ss-tt)
   res=min(res,d1,d2)
 print res
Problem p03280 (python)

Fixed submission:
#abc106a

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

Buggy submission (verdict: Runtime Error):
#abc106c
import sys

s=raw_input()
k=int(raw_input())
if s.count('1')==len(s):
 print '1'
 sys.exit()
for i in xrange(k):
 if s[i]!='!':
  print s[i]
  sys.exit()
Problem p03282 (python)

Fixed submission:
#abc106c
import sys

s=raw_input()
k=int(raw_input())
if s.count('1')==len(s):
 print '1'
 sys.exit()
for i in xrange(k):
 if s[i]!='1':
  print s[i]
  sys.exit()
print '1'

Buggy submission (verdict: Runtime Error):
#abc106c
import sys

s=raw_input()
k=int(raw_input())
while True:
 if s:
  if s[0]=='1':
   s=s[1:]
  print s[0]
  sys.exit()
 else:
  print '1'
  sys.exit()
Problem p03385 (python)

Fixed submission:
#abc093a

s=raw_input()
if s.count('a')==1 and s.count('b')==1 and s.count('c')==1:
 print 'Yes'
else:
 print 'No'

Buggy submission (verdict: Runtime Error):
#abc093b
import sys

a,b,k=map(int,raw_input().split())
if a==b:
 print a
 sys.exit()
l1=[i for i in xrange(a,a+k)]
l2=[i for i in xrange( b-k+1,b+1)]
s1=set(l1)
s2=set(l2)
if b-k>=k-a:
 res=list(s1 | s2)
else:
 res=list(s1 & s2)
res.sort()
for i in xrange(len(res)):
 print res[i]

Buggy submission (verdict: Runtime Error):
#abc093b
import sys

a,b,k=map(int,raw_input().split())
if a==b:
 print a
 sys.exit()
l1=[i for i in xrange(a,a+k)]
l2=[i for i in xrange( b-k+1,b+1)]
s1=set(l1);print s1
s2=set(l2);print s2
if b-k>=k-a:
 res=list(s1 | s2)
else:
 res=list(s1 & s2)
res.sort()
for i in xrange(len(res)):
 print res[i]
Problem p03415 (python)

Fixed submission:
#abc090a

c=[]
for i in xrange(3):
 c.append(raw_input())
print c[0][0]+c[1][1]+c[2][2]

Buggy submission (verdict: Runtime Error):
#abc090b

a,b=map(int,raw_input().split())
cnt=0
for i in xrange(a,b+1):
 s=i%10
 t=i/10000%10
 u=i/10%10
 v=i/1000%10
 if s==t and u==v:
  cnt+=1
print cnt
Problem p03424 (python)

Fixed submission:
#abc089b

n=int(raw_input())
s=map(str,raw_input().split())
ss=set(s)
cnt=len(ss)
if cnt==3:
 print 'Three'
else:
 print 'Four'

Buggy submission (verdict: Runtime Error):
#abc089b

n=int(raw_input())
s=map(str,raw_input().split())
ss=set(s)
cnt=len(ss)
1f cnt=3:
 print 'Three'
else:
 print 'Four'
Problem p03433 (python)

Fixed submission:
#ABC088A

n=int(raw_input())
a=int(raw_input())
if n%500>a:
 print 'No'
else:
 print 'Yes'

Buggy submission (verdict: Runtime Error):
#ABC088C
import sys

c=[map(int,raw_input().split()) for i in xrange(3)]
a=[0,0,0]
b=[0,0,0]
b[0],b[1],b[2]=c[0][0],c[0][1],c[0][2]
a[1],a[2]=c[1][0]-b[0],c[2][0]-b[0]
for i in xrange(3):
 for j in xrange(3):
  if c[i][j]!=a[i]+b[j]:
   print 'No'
   sys.exit()
print 'Yes'
Problem p03495 (python)

Fixed submission:
#abc081c
import collections

n,k=map(int,raw_input().split())
a=map(int,raw_input().split())
cnt=collections.Counter(a)
l=[]
for k1,v in cnt.items():
 l.append(v)
l2=sorted(l,reverse=True)
temp=0
for i in xrange(min(k,len(l2))):
 temp+=l2[i]
print n-temp

Buggy submission (verdict: Runtime Error):
#abc081c
import collections
import sys

n,k=map(int,raw_input().split())
a=map(int,raw_input().split())
if n==k:
 print 0
 sys.exit()
cnt=collections.Counter(a)
l=[]
for k1,v in cnt.items():
 l.append(v)
l2=sorted(l,reverse=True)
temp=0
for i in xrange(k):
 temp+=l2[i]
print n-temp
Problem p03543 (python)

Fixed submission:
#ABC079C

n=raw_input()
s=[]
for i in xrange(4):
 s.append(n[i])
if s[0]==s[1]==s[2] or s[1]==s[2]==s[3]:
 print 'Yes'
else:
 print 'No'

Buggy submission (verdict: Runtime Error):
#ABC079C

n=raw_input()
s=[]
for i in xrange(4):
 s.append(n[i])
if s[0]==s[1]==s[2] or s[1]==s[2]==s[3] or s[2]==s[3]==s[4]:
 print 'Yes'
else:
 print 'No'
Problem p03563 (python)

Fixed submission:
#ABC076A

r=int(raw_input())
g=int(raw_input())
print g*2-r

Buggy submission (verdict: Runtime Error):
#ABC076A

r=int(raw_input())
d=int(raw_input())
print g*2-r

Buggy submission (verdict: Runtime Error):
#ABC076A

r=int(raw_input())
d=int(raw_input())
print g*2-r
Problem p03573 (python)

Fixed submission:
#ABC075A

a,b,c=map(int,raw_input().split())
if a==b:
 print c
elif a==c:
 print b
else:
 print a

Buggy submission (verdict: Runtime Error):
#ABC075B

h,w=map(int,raw_input().split())
l=[]
for i in xrange(h):
 l.append(list(raw_input()))
for y in xrange(h):
 for x in xrange(w):
  if l[y][x]=='#':
   continue
  cnt=0
  for dy in [-1,0,1]:
   for dx in [-1,0,1]:
    ny=y+dy
    nx=x+dx
    if 0<=ny<h and 0<=nx<w:
     if l[ny][nx]=='#':
      cnt+=1
  l[y][x]=str(cnt)
for i in xrange(h):
 print ''.join(l[i])
Problem p03639 (python)

Fixed submission:
#ARc080C

n=int(raw_input())
l=map(int,raw_input().split())
cnt1=cnt2=cnt4=0
for i in xrange(n):
 if l[i]%4==0:
  cnt4+=1
 elif l[i]%2==0:
  cnt2+=1
 else:
  cnt1+=1
if cnt4>=cnt1:
 print 'Yes'
elif cnt4==cnt1-1 and cnt2==0:
 print 'Yes'
else:
 print 'No'

Buggy submission (verdict: Runtime Error):
#ARc080C

n=int(raw_input())
l=map(int,raw_input().split())
cnt1=cnt2=cnt4=0
for i in xrange(n):
 if (l[i]%2)%2==0:
  cnt4+=1
 elif l[i]%2==0:
  cnt2+1=1
 elif l[i]%2:
  cnt1+=1
if cnt2==0:
 if cnt1<=cnt4+1:
  print 'Yes'
 else:
  print 'No'
else:
 if cnt1<=cnt4:
  print 'Yes'
 else:
  print 'No'
Problem p03671 (python)

Fixed submission:
#ABC066A

l=map(int,raw_input().split())
ls=sorted(l)
print ls[0]+ls[1]

Buggy submission (verdict: Runtime Error):
#abc066d
mod=10**9+7

def com(n,r,m):
 f=[1,1]
 for i in range(2,n+1):
  f.append(f[i-1]*i%m)
 return f[n]*pow(f[r]*f[n-r]%m,m-2,m)%m


N=int(raw_input())
A=map(int,raw_input().split())
c=[-1]*N
for i in range(N+1):
 if c[A[i]-1]!=-1:
  break
 c[A[i]-1]=i
j=c[A[i]-1]
i=N-i
for k in range(1,N+2):
 res=com(N+1,k,mod)
 if k-1<=i+j:
  res-=com(i+j,k-1,mod)
 print res%mod
Problem p03693 (python)

Fixed submission:
#ABC064A

r,g,b=raw_input().split()
if int(r+g+b)%4:
 print 'NO'
else:
 print 'YES'

Buggy submission (verdict: Runtime Error):
n=int(raw_input())
a=map(int,raw_input().split())
#color=[hai,cha,midori,mizu,ao,ki,daidai,aka]
c=[0 for i in xrange(8)]
ext=0
for x in a:
 if 1<=x<=399:
  c[0]+=1
 elif 400<=x<=799:
  c[1]+=1
 elif 800<=x<=1199:
  c[2]+=1
 elif 1200<=x<=1599:
  c[3]+=1
 elif 1600<=x<=1999:
  c[4]+=1
 elif 2000<=x<=2399:
  c[5]+=1
 elif 2400<=x<=2799:
  c[6]+=1
 elif 2800<=x<=3199:
  c[7]+=1
 else:
  ext+=1
print c
res1=len(c)-c.count(0)
res2=min(res1+ext,len(c))
print res1,res2
Problem p03698 (python)

Fixed submission:
#ABC063B

s=raw_input()
l1=len(s)
l2=len(set(s))
if l1==l2:
 print 'yes'
else:
 print 'no'

Buggy submission (verdict: Runtime Error):
#ABC063B

s=raw_input()
l1=len(s)
l2=len(set(s))
if li==l2:
 print 'yes'
else:
 print 'no'
Problem p03799 (python)

Fixed submission:
#ARC069A

n,m=map(int,raw_input().split())
if n>m/2:
 res=m/2
else:
 res=n+(m-2*n)/4
print res

Buggy submission (verdict: Runtime Error):
#ARC069A

n,m=map(int,raw_input().split())
if n>m*2:
 res=c/2
else:
 res=n+(m-2*n)/4
print res

Buggy submission (verdict: Runtime Error):
#ARC069A

n,m=map(int,raw_input().split())
if n>m*2:
 res=c/2
else:
 res=(n*2+m)/4
print res
Problem p03817 (python)

Fixed submission:
#ARC068C

n=int(raw_input())

res=n/11*2
ref=n%11
if ref==0:
 print res
elif ref<=6:
 print res+1
else:
 print res+2

Buggy submission (verdict: Runtime Error):
#ARC068C

n=int(raw_input())
if x<=6:
 print 1
else:
 res=n/11*2
 if n%11>=6:
  res+=2
 else:
  res+=1
 print res
Problem p03828 (python)

Fixed submission:
#ARC052C

n=int(raw_input())
s=[1 for i in range(n+1)]
res=1
for i in range(2,n+1):
 if s[i]:
  for j in range(i*2,n+1,i):
   s[j]=0
  cnt=0
  temp=n
  while temp:
   cnt+=temp/i
   temp/=i
  res=res*(cnt+1)%(10**9+7)
print res

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

n=int(raw_input())
m=sympy.factorint(math.factorial(n))
res=1
v=m.values()
for i in xrange(len(v)):
 res*=v[i]+1
print res%(10**9+7)

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

n=int(raw_input())
m=sympy.factorint(math.factorial(n))
print m
res=1
v=m.values()
for i in xrange(len(v)):
 res*=v[i]+1
print res%(10**9+7)
Problem p03844 (python)

Fixed submission:
#ABC050A

res=raw_input()
res=res.replace(' ','')
print eval(res)

Buggy submission (verdict: Runtime Error):
#ABC050B

n=int(raw_input())
t=map(int,raw_input().split())
m=int(raw_input())
v=[]
for i in xrange(m):
 u=t[:]
 p,x=map(int,raw_input().split())
 u[p-1]=x
 v.append(sum(u))
for i in xrange(m):
 print v[i]
Problem p03860 (python)

Fixed submission:
#ABC048A

print 'A'+raw_input().split()[1][0]+'C'

Buggy submission (verdict: Runtime Error):
ABC048B

a,b,x=map(int,raw_input().split())
res=b/x
if a!=0:
 res-=(a-1)/x
else:
 res+=1
print res
Problem p03861 (python)

Fixed submission:
#ABC048B

a,b,x=map(int,raw_input().split())
res=b/x
if a!=0:
 res-=(a-1)/x
else:
 res+=1
print res

Buggy submission (verdict: Runtime Error):
ABC048B

a,b,x=map(int,raw_input().split())
res=b/x
if a!=0:
 res-=(a-1)/x
else:
 res+=1
print res
Problem p03937 (python)

Fixed submission:
#agc007a

h,w=map(int,raw_input().split())
cnt=0
for i in range(h):
 cnt+=raw_input().count('#')
if cnt==h+w-1:
 print 'Possible'
else:
 print 'Impossible'

Buggy submission (verdict: Runtime Error):
#agc007a

h,w=map(int(raw_input())
cnt=0
for i in range(h):
 cnt+=raw_input().count('#')
if cnt==h+w-1
 print 'Possible'
else:
 print 'Impossible'
Problem p03962 (python)

Fixed submission:
#ABC046A
s=set(raw_input().split())
print len(s)

Buggy submission (verdict: Runtime Error):
#ABC046B

n,k=map(int,raw_input().split())
print k*((k-1)**(n-1))
Problem p04019 (python)

Fixed submission:
#AGC003A

s=raw_input()
l=[s[i] for i in xrange(len(s))]
if l.count('N')==0 and l.count('S')>0:
 print "No"
elif l.count('N')>0 and l.count('S')==0:
 print "No"
elif l.count('E')==0 and l.count('W')>0:
 print "No"
elif l.count('E')>0 and l.count('W')==0:
 print "No"
else:
 print "Yes"

Buggy submission (verdict: Runtime Error):
#AGC003B

n=int(raw_input())
s=[]
for i in xrange(1,n+1):
 x=int(raw_input())
 for j in xrange(x):
  s.append(i)
cnt=0
i=0
while i<len(s)-1:
 if s[i+1]-s[i]==0 or s[i+1]-s[i]==1:
  cnt+=1
  i+=2
 else:
  i+=1
print cnt

Buggy submission (verdict: Runtime Error):
#AGC003B

n=int(raw_input())
s=[]
for i in xrange(1,n+1):
 x=int(raw_input())
 for j in xrange(x):
  s.append(i)
cnt=0
i=0
while i<len(s)-1:
 if s[i+1]-s[i]==0 or s[i+1]-s[i]==1:
  cnt+=1
  i+=2
 else:
  i+=1
print cnt
Problem p04032 (python)

Fixed submission:
#coding: utf-8
#ABC043D
import sys

s=raw_input()

for i in xrange(len(s)-1):
 if s[i]==s[i+1]:
  print i+1,i+2
  sys.exit()

for i in xrange(len(s)-2):
 if s[i]==s[i+2]:
  print i+1,i+3
  sys.exit()
  
print -1,-1

Buggy submission (verdict: Runtime Error):
#coding: utf-8
#ABC043D
import sys

s=raw_input()

for i in xrange(len(s)-1):
 if s[i]==s[i+1]:
  print i+1,i+2
  sys.exit()

for i in xrange(len(s)-1):
 if s[i]==s[i+2]:
  print i+1,i+3
  sys.exit()
  
print -1,-1
Problem p04043 (python)

Fixed submission:
#coding: utf-8
#ABC042A

l=map(int,raw_input().split())

if l.count(5)==2 and l.count(7)==1:
 print "YES"
else:
 print "NO"

Buggy submission (verdict: Runtime Error):
#coding: utf-8
#ABC042C

n,k=map(int,raw_input().split())
d=raw_input().split()

while True:
 if all(x not in str(n) for x in d):
  res=n
  break
 n+=1
 
print res

Buggy submission (verdict: Runtime Error):
#coding: utf-8
#ABC042B

n,l=map(int,raw_input().split())
s=[raw_input() for i in xrange(n)]

s.sort()
res="".join(s)
print res