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

Fixed submission:
N=int(input())

x=N%10
if x==3:
  print('bon')

elif x==0 or x==1 or x==6 or x==8:
  print('pon')

else:
  print('hon')

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

x=N%10
if X==3:
  print('bon')

elif x==0:
  print('pon')

elif x==1:
  print('pon')

elif x==6:
  print('pon')

elif x==8:
  print('pon')
  
else:
  print('hon')

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

x=N%10
if X==3:
  print('bon')

elif x==0 or x==1 or x==6 or x==8:
  print('pon')

else:
  print('hon')
Problem p02678 (python)

Fixed submission:
n,m=map(int,input().split())
lst=[[] for i in range(n)]
visited=[False for i in range(n)]
ans=[0]*n

for i in range(m):
      a,b=map(int,input().split())
      lst[a-1].append(b-1)
      lst[b-1].append(a-1)

Q=[0]
visited[0]=True

while Q:
  v=Q.pop(0)
  for i in lst[v]:
        if visited[i]==False:
              visited[i]=True
              ans[i]=v
              Q.append(i)

print('Yes')

for i in range(1,n):
      print(ans[i]+1)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
lst=[[] for i in range(n)]
visited=[True]+[False]*(n-1)
ans=[0]*n

for i in range(m):
      a,b=map(int,input().split())
      lst[a-1].append(b-1)
      lst[b-1].append(a-1)

Q=[0]

While Q:
  v=Q.pop(0)
  for i in lst[v]:
        if visited[i]==False:
              visited[i]=True
              ans[i]=v
              Q.append(v)

print('Yes')

for i in range(1,n):
      print(ans[i])
Problem p02687 (python)

Fixed submission:
s=input()
if s=='ABC':
  print('ARC')

elif s=='ARC':
  print('ABC')

Buggy submission (verdict: Runtime Error):
s=input()
if s==ABC:
  print('ARC')

elif s==ARC:
  print('ABC')
Problem p02691 (python)

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

plus=[0]*1000000
minus=[0]*1000000

for i in range(n):
  ene=i+1
  pin=a[i]
  pl,mi=ene+pin,ene-pin
  if 0<=pl<1000000:
    plus[pl]+=1
  if 0<=mi<1000000:
    minus[mi]+=1
  
for i in range(1000000):
  ans+=plus[i]*minus[i]
  

print(ans)

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

plus=[0]*1000000
minus=[0]*1000000

for i in range(n):
  ene=i+1
  pin=a[i]
  pl,mi=ene+pin,ene-pin
  plus[pl]+=1
  minus[mi]+=1
  
for i in range(1000000):
  ans+=plus[i]*minus[i]
  

print(ans)
Problem p02694 (python)

Fixed submission:
x=int(input())
total=100
years=0
while total<x:
  total*=1.01
  years+=1
  total=int(total)
print(years)

Buggy submission (verdict: Runtime Error):
x=int(input())
money=100
i=0
while true:
  money*1.01
  i+=1
  if money>=x:
    break
print i
Problem p02705 (python)

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

Buggy submission (verdict: Runtime Error):
import mathmatics
r=int(input())
print(2*r*pi)
Problem p02706 (python)

Fixed submission:
n,m=map(int,input().split())
a=list(map(int,input().split()))
x=sum(a)
if n<x:
  print('-1')
else:
  print(n-x)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=list(map,int().input())
x=sum(a)
if n<x:
  print('-1')
else:
  print(n-x)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
A=list(map(int,input().split()))

sum=sum(A)

if N>=sum:
  print('N-sum')
else('-1')

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
A=list(map(int,input().split()))

sum=sum(A)

if N>=sum:
  print(N-sum)
else(-1)
Problem p02708 (python)

Fixed submission:
mod=10**9+7
x=[0]+[0]
for i in range(1,2*10**5+10):
  x.append((x[-1]+i)%mod)

ans=0


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


for i in range(k,n+2):
  ans+=(i*(n+n+1-i)//2)-x[i]+1
  ans%=mod
  
print(ans)

Buggy submission (verdict: Runtime Error):
mod=10**9+7
x=[0]+[0]
for i in range(1,2*10**5):
  x.append((x[-1]+i)%mod)

ans=0


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


for i in range(k,n+2):
  ans+=(i*(n+n+1-i)//2)-x[i]+1
  ans%=mod
  
print(ans)
Problem p02713 (python)

Fixed submission:
from math import gcd
k=int(input())
cnt=0
for i in range(1,k+1):
  for j in range(1,k+1):
    a=gcd(i,j)
    for k in range(1,k+1):
      cnt+=gcd(a,k)
print(cnt)

Buggy submission (verdict: Runtime Error):
import math
k=int(input())
sum=0

for a in range(1,k+1):
  for b in range(1,k+1):
    for c in range(1,k+1):
      sum+=math.gcd(a,b,c)

      
print(sum)
Problem p02718 (python)

Fixed submission:
n,m=map(int,input().split())
a=list(map(int,input().split()))
count=0
for i in a:
  if i>=sum(a)/(4*m):
    count+=1
if count>=m:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
import math
n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
if a(n-m)<math.ceil(sum(a)//(4*m)):
  print('No')
else:
  print('Yes')
Problem p02719 (python)

Fixed submission:
n,k=map(int,input().split())
a=n%k
b=k-a
print(min(a,b))

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

while True:
  x=n
  n=abs(n-k)
  if x==n:
    break
  
  print (n)

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

while True:
  x=n
  n=abs(n-k)
  if x==n:
    break
  
  print n
Problem p02724 (python)

Fixed submission:
x=int(input())
i=x//500
a=(x-i*500)//5
print(i*1000+a*5)

Buggy submission (verdict: Runtime Error):
x=int(input())
i=x//500
a=(x-i)//5
sum=i*1000+a*5
print sum
Problem p02727 (python)

Fixed submission:
x,y,a,b,c=map(int,input().split())
p=list(map(int,input().split()))
q=list(map(int,input().split()))
r=list(map(int,input().split()))

p.sort()
q.sort()


sin=p[a-x:]+q[b-y:]+r

sin.sort()

print(sum(sin[len(sin)-x-y:]))

Buggy submission (verdict: Runtime Error):
x,y,a,b,c=map(int,input().split())
p=list(map(int,input().split()))
q=list(map(int,input().split()))
r=list(map(int,input().split()))

sin=p[a-x:]+q[b-y:]
sin.sort(reverse=True)

r.sort(reverse=True)

ans=sum(sin)

for i in sin:
  if r[0]>i:
    ans+=r[0]-i
    r.pop(0)
    

print(ans)

Buggy submission (verdict: Runtime Error):
x,y,a,b,c=map(int,input().split())
p=list(map(int,input().split()))
q=list(map(int,input().split()))
r=list(map(int,input().split()))

sin=p[:-x]+q[:-y]
sin.sort(reverse=True)

r.sort(reverse=True)

ans=sum(sin)

for i in sin:
  if r[0]>i:
    ans+=r[0]-i
    r.pop(0)
    

print(ans)
Problem p02730 (python)

Fixed submission:
s=input()
ans='No'
if s==s[::-1]:
  t=s[:len(s)//2]
  if t==t[::-1]:
    u=s[len(s)//2+1:]
    if u==u[::-1]:
      ans='Yes'
print(ans)

Buggy submission (verdict: Runtime Error):
s=input()
a=s[:len(s)//2]
b=s[(len(s)//2)+1:]
if a==b:
  if a==reversed(a) and b==reversed(b):
  print('Yes')
  else:
    print('No')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s=input()
a=s[:len(s)//2]
b=s[(len(s)//2)+1:]
if a==b:
  if a==reversed(a) and b==reversed(b):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s=input()
a=s[:len(s)//2]
b=s[(len(s)//2)+1:]
if a==a.reverse() and b==b.reverse():
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s=input()
a=s[:len(s)//2]
b=s[(len(s)//2)+2:]
if a==a.reverse() and b==b.reverse():
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s=input()
n=len(s)
if s[0]==s[(n-3)/2] and s[(n+1)/2]==s[n-1]:
  print ('Yes')
else:
  print('No')
Problem p02756 (python)

Fixed submission:
from collections import deque


Q=deque(list(input()))

q=int(input())

cnt=0

for i in range(q):
  x=input()
  if x[0]=='1':
    cnt+=1
    cnt%=2
    
  elif x[0]=='2':
    if x[2]=='1':
        if cnt%2==0:
            Q.appendleft(x[4])
        else:
            Q.append(x[4])

    else:
        if cnt%2==0:
            Q.append(x[4])
        else:
            Q.appendleft(x[4])
      
if cnt%2==1:
  Q.reverse()


print(''.join(Q))

Buggy submission (verdict: Runtime Error):
from collections import deque

z=list(input())
Q=deque()
Q.append((z))
q=int(input())

cnt=0

for i in range(q):
  x=input()
  if x[0]=='1':
    cnt+=1
    cnt%=2
    
  elif x[0]=='2':
    if x[2]=='1':
        if cnt%2==0:
            Q.appendleft(x[4])
        else:
            Q.append(x[4])

    else:
        if cnt%2==0:
            Q.append(x[4])
        else:
            Q.appendleft(x[4])
      
if cnt%2==1:
  Q.reverse()


print(''.join(Q))

Buggy submission (verdict: Runtime Error):
from collections import deque

z=list(input())
Q=deque()
Q.append(z)
q=int(input())

cnt=0

for i in range(q):
  x=input()
  if x[0]=='1':
    cnt+=1
    cnt%=2
    
  elif x[0]=='2':
    if x[2]=='1':
        if cnt%2==0:
            Q.appendleft(x[4])
        else:
            Q.append(x[4])

    else:
        if cnt%2==0:
            Q.append(x[4])
        else:
            Q.appendleft(x[4])
      
if cnt%2==1:
  Q.reverse()


print(''.join(Q))
Problem p02761 (python)

Fixed submission:
n,m=map(int,input().split())
lst=[list(map(int,input().split())) for i in range(m)]
ans=-1
if n>=2:
  for i in range(10**(n-1),10**n):
    k=['0']+list(str(i))
    judge=True
    for j in lst:
      if k[j[0]]!=str(j[1]):
        judge=False
        break
    if judge:
      ans=i
      break

elif n==1:
  for i in range(10):
    k=['0']+list(str(i))
    judge=True
    for j in lst:
      if k[j[0]]!=str(j[1]):
        judge=False
        break
    if judge:
      ans=i
      break
print(ans)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
lst=[list(map(int,input().split())) for i in range(m)]
ans=-1
if n>=2:
  for i in range(10**(n-1),10**n):
    k=['0']+list(str(i))
    judge=True
    for j in lst:
      if k[j[0]]!=str(j[1]):
        judge=False
        break
    if judge:
      ans=i
      break

elif n==1:
  for i in range(10):
  k=['0']+list(str(i))
  judge=True
  for j in lst:
    if k[j[0]]!=str(j[1]):
      judge=False
      break
  if judge:
    ans=i
    break
print(ans)
Problem p02765 (python)

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

if n>=10:
  print(r)

else:
  print(r+(10-n)*100)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
sum=0
while n>=1:
  n=n/k
  sum+=1
  
print (sum)
Problem p02772 (python)

Fixed submission:
n=int(input())
ans='APPROVED'
a=list(map(int,input().split()))
for x in a:
  if x%2==0:
    if x%3!=0 and x%5!=0:
      ans='DENIED'
      break
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
ans='APPROVED'
for i in range(n):
  x=int(input())
  if x%2==0:
    if x%3!=0 and x%5!=0:
      ans='DENIED'
      break
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
count=0
for i in a:
  if i%2==0:
    count+=1
  if i%2==0 and i%3!=0 and i%5!=0:
    print('DENIED')
if count=0:
  print('DENIED')
else:
  print('APPROVED')

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
x=[]
for i in a:
  if i%2==0:
    x+=i
for y in x:
  if x=[]:
    print('APPROVED')
  elif y%3!=0 and y%5!=0:
    print('DENIED')
  else:
    print('APPROVED')

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
x=[]
for i in a:
  if i%2==0:
    x+=i
for y in x:
  if y%3!=0 and y%5!=0:
    print('DENIED')
  else:
    print('APPROVED')
Problem p02778 (python)

Fixed submission:
s=input()
print('x'*len(s))

Buggy submission (verdict: Runtime Error):
s=input()
print(x*len(s))
Problem p02780 (python)

Fixed submission:
import itertools

n,k=map(int,input().split())
a=list(map(int,input().split()))
a=list(map(lambda x:(x+1)/2,a))

a=[0]+list(itertools.accumulate(a))
ans=0

for i in range(n-k+1):
  ans=max(ans,a[i+k]-a[i])
  
print(ans)

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

q=map(lambda x:(x+1)/2,p)

ans=0

for i in range(n-k+1):
  ans=max(ans,sum(q[i,i+k]))
  
print(ans)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
p=list(map(int,input().split()))
p=map(lambda x:(x+1)/2,p)
a=[]
for i in range(n+1-k):
  a+=[p[i:i+k]]
print(max(a))
Problem p02783 (python)

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

Buggy submission (verdict: Runtime Error):
import math
print(math.ceil(int(input())/int(input())))
Problem p02786 (python)

Fixed submission:
n=int(input())
x=(bin(n))
print(2**(len(x)-2)-1)

Buggy submission (verdict: Runtime Error):
x=(bin(int(input()))
print(2**(len(x)-2)-1)
Problem p02791 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=2*10**5
cnt=0
for i in a:
  if b>=i:
    cnt+=1
    b=i

print(cnt)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=[]
cnt+0
for i in a:
  if b==[] or min(b)>=i:
    cnt+=1
    b.append(i)
  else:
    b.append(i)
print(cnt)
Problem p02802 (python)

Fixed submission:
n,m=map(int,input().split())
lst=[list(input().split()) for i in range(m)]
x,y=0,0
cnt=['?']+[0]*n
cnt2=[0]+[0]*n
for i in lst:
  if i[1]=='WA':
    pin=int(i[0])
    if cnt[pin]!='AC':
      cnt2[pin]+=1
  elif i[1]=='AC':
    cnt[int(i[0])]='AC'

x=cnt.count('AC')

for i in range(len(cnt)):
  if cnt[i]=='AC':
    y+=cnt2[i]
print(x,y)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
lst=[list(input().split()) for i in range(m)]
x,y=0,0
cnt=['?']+[0]*n
cnt2=[0]+[0]*n
for i in lst:
  if i[1]=='WA':
    pin=int(i[0])
    if cnt[pin]!='AC':
      cnt2[pin]+=1
  elif i[1]=='AC':
    cnt[int(i[0])]='AC'

x=cnt.count('AC')

for i in range(len(cnt)+1):
  if cnt[i]=='AC':
    y+=cnt2[i]
print(x,y)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
lst=[list(map(int,input().split())) for i in range(m)]
x,y=0,0
cnt=['?']+[0]*n
for i in lst:
  if i[1]=='WA':
    if cnt[i[0]]!='AC':
      y+=1
  elif i[1]=='AC':
    cnt[i[0]]='AC'

x=cnt.count('AC')

print(x,y)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=0
b=0
x=[]
for i in range(m):
  s,t=input().split()
  s=int(s)
  if s not in x:
    if t='AC':
      a+=1
      x.append(s)
    else:
      b+=1
print(a,b)
Problem p02804 (python)

Fixed submission:
import itertools

n,k=map(int,input().split())
a=list(map(int,input().split()))
mod=10**9+7
ans=0
a.sort()
a=list(itertools.accumulate(a))
pin=0


lst=[1,1]
for i in range(2,n+10):
  lst.append((lst[-1]*i)%mod)

def combinations(n,r):
  xxx=lst[n]
  xxx*=pow(lst[n-r],mod-2,mod)
  xxx%=mod
  xxx*=pow(lst[r],mod-2,mod)
  xxx%=mod

  return xxx

if k==1:
    print(0)
    exit()


for i in range(n-k+1):
  pin+=1
  now=n-k+1-i
  ans+=(a[-1]-a[-now-1]-a[now-1])*combinations(pin+k-3,k-2)
  ans%=mod


print(ans)

Buggy submission (verdict: Runtime Error):
import itertools

n,k=map(int,input().split())
a=list(map(int,input().split()))
mod=10**9+7
ans=0
a.sort()
a=list(itertools.accumulate(a))
pin=0


lst=[1,1]
for i in range(2,n+10):
  lst.append((lst[-1]*i)%mod)

def combinations(n,r):
  xxx=lst[n]
  xxx*=pow(lst[n-r],mod-2,mod)
  xxx%=mod
  xxx*=pow(lst[r],mod-2,mod)
  xxx%=mod

  return xxx


for i in range(n-k+1):
  pin+=1
  now=n-k+1-i
  ans+=(a[-1]-a[-now-1]-a[now-1])*combinations(pin+k-3,k-2)
  ans%=mod


print(ans)
Problem p02806 (python)

Fixed submission:
n=int(input())
a=[(input().split()) for _ in range(n)]
x=input()
cnt='x'
for i in a:
  if cnt!='x':
    z=int(i[1])
    cnt+=z
  if i[0]==x:
    cnt=0
print(cnt)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[list(map(input().split())) for _ in range(n)]
x=input()
cnt='x'
for i in a:
  if cnt!='x':
    z=int(i[1])
    cnt+=z
  if i[0]==x:
    cnt=0
print(cnt)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[list(map(input().split())) for _ in range(n)]
x=input()
cnt='x'
for i in a:
  if cnt!='x':
    z=int(i[1])
    cnt+=z
    if i[0]==x:
      cnt=0
print(cnt)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[list(map(input().split())) for _ in range(n)]
x=input()
cnt='x'
for i in a:
  if cnt!='x':
    z=int(i[1])
    cnt+=z
    if i[0]==x:
    cnt=0
print(cnt)
Problem p02813 (python)

Fixed submission:
import itertools
n=int(input())
a=tuple(map(int,input().split()))
b=tuple(map(int,input().split()))
lst=[i for i in itertools.permutations(range(1,n+1))]
cnt=0
for i in lst:
  if a==i:
    a=cnt
  if b==i:
    b=cnt
  cnt+=1
print(abs(a-b))

Buggy submission (verdict: Runtime Error):
import itertools
n=int(input())
a=tuple(map(int,input().split()))
b=tuple(map(int,input().split()))
lst=[i for i in itertools.permutations(range(1,n+1))]
cnt=0
for i in lst:
  if a==i:
    a=cnt
  elif b==i:
    b=cnt
  cnt+=1
print(abs(a-b))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c,d=0,0
def kaijyou(x):
  y=1
  for i in range(1,x+1):
    y*=i
  return y
for i in range(n):
  c+=kaijyou(n-i-1)*(max(0,a[i]-1))
for i in range(n):
  d+=kaijyou(n-i-1)*(max(0,b[i]-1))
print(abs(a-b))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
total1=0
total2=0
def pon(p):
  s=1
  for i in range(1,p+1):
  s*=i
  return s
x=1
y=1
for i in a:
  total1+=(i-1)*pon(n-x)
  x+=1
for i in b:
  total2+=(i-1)*pon(n-y)
  y+=1
print(abs(total1-total2))
Problem p02818 (python)

Fixed submission:
a,b,k=map(int,input().split())
if a>=k:
  print(a-k,b)
  
else:
  print(0,max(0,a+b-k))

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

elif a+b<=k:
  print(0,0)

  elif a>k:
  print(a-k,b)
  
else:
  print(0,b+a-k)

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
if a==k:
  print('0',b)

elif (a+b)<k:
  print('0','0')

  elif a>k:
  print(a-k,b)
  
else:
  print('0',b+a-k)

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
if a==k:
  print('0',b)

elif a+b<=k:
  print('0','0')

  elif a>k:
  print(a-k,b)
  
else:
  print('0',b+a-k)

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
if a=k:
  print(a-a,b)
  
elif a>k:
  print(a-k,b)
  
else:
  print(a-a,b+a-k)

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
if a=k:
  print('0',b)
  
elif a>k:
  print((a-k),b)
  
else:
  print('0',(b+a-k))

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
if a=k:
  print('0',b)
  
elif a>k:
  print(a-k,b)
  
else:
  print('0',b+a-k)
Problem p02842 (python)

Fixed submission:
n=int(input())
ans=':('
for i in range(1,n+1):
  if int((i*1.08)//1)==n:
    ans=i
    break
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
ans=:(
for i in range(1,n):
  if int((i*1.08)//1)==n:
    ans=i
    break
print(ans)
Problem p02843 (python)

Fixed submission:
x=int(input())
if x>=2100:
  print(1)
  exit()

ans=[0]*2100
for a in range(22):
  for b in range(22):
    for c in range(22):
      for d in range(22):
        for e in range(22):
          for f in range(21):
            y=a*100+b*101+c*102+d*103+e*104+f*105
            if y<=2099:
              ans[y]=1
            
print(ans[x])

Buggy submission (verdict: Runtime Error):
x=int(input())
if x>=2100:
  print(1)
  exit()

ans=[0]*2100
for a in range(22):
  for b in range(22):
    for c in range(22):
      for d in range(22):
        for e in range(22):
          for f in range(21):
            ans[a*100+b*101+c*102+d*103+e*104+f*105]=1
            
print(ans[x])

Buggy submission (verdict: Runtime Error):
x=int(input())
if x>=2100:
  print(1)
  exit()

ans=[0]*2100
for a in range(22):
  for b in range(22):
    for c in range(22):
      for d in range(22):
        for e in range(22):
          for f in range(21):
            ans[a*100+b*101+c*102+d*103+e*104+f*105]=1
            
print(ans(x))
Problem p02861 (python)

Fixed submission:
import itertools
n=int(input())
lst=[list(map(int,input().split())) for i in range(n)]
per=[i for i in itertools.permutations(range(n))]
ans=0
for i in per:
  for j in range(n-1):
    ans+=pow((lst[i[j]][0]-lst[i[j+1]][0])**2+(lst[i[j]][1]-lst[i[j+1]][1])**2,0.5)
print(ans/len(per))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[input().split() for i in range(n)]
x=0
y=1
for i in a:
  for j in a:
    x+=pow((i[0]-j[0])**2+(i[1]-j[1])**2,0.5)
for k in range(1,n+1):
  y*=k
print(x/y)
Problem p02886 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
aa=0
for i in a:
  x=i**2
  aa+=x
print(((sum(a)**2)-aa)//2)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
sum=0
for i in a:
  x=i**2
  sum+=x
print((sum(a)**2)-sum)
Problem p02899 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=[0]*n
c=''
x=0
for i in a:
  x+=1
  b[i-1]=x
for j in b:
  c+=str(j)
  c+=' '
print(c[:-1])

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=[0]*n
c=''
x=0
for i in a:
  x+=1
  b[i-1]=x
for j in b:
  c+=j
  c+=' '
print(c[:-1])
Problem p02910 (python)

Fixed submission:
s=input()
if 'L' in s[0::2] or 'R' in s[1::2]:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
s=input()
if s[0::2]=='L' or s[1::2]=='R':
  print('No')
else('Yes')
Problem p02917 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
total=a[0]+a[-1]
for i in range(n-2):
  total+=min(a[i],a[i+1])
print(total)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
x=sum(b)
for i in range(len(a)-1):
  if a[i+1]-a[i]==1:
    d=a[i]
    x+=c[d-1]
print(x)
Problem p02936 (python)

Fixed submission:
n,q=map(int,input().split())
lst=[[] for i in range(n)]
ans=[0]*n

for i in range(n-1):
      a,b=map(int,input().split())
      lst[a-1].append(b-1)
      lst[b-1].append(a-1)

for i in range(q):
    s,t=map(int,input().split())
    ans[s-1]+=t

Q=[0]

flag=[True]+[False]*(n-1)


while Q:
  v=Q.pop()
  flag[v]=True
  for i in lst[v]:
    if flag[i]:
      continue
    flag[i]=True
    ans[i]+=ans[v]
    Q.append(i)


print(' '.join([str(i) for i in ans]))

Buggy submission (verdict: Runtime Error):
n,q=map(int,input().split())
tree=[list(map(int,input().split())) for i in range(n-1)]
point=[list(map(int,input().split())) for i in range(q)]

ans=['?']+[0]*n

def dfs(x,y):
  ans[x]+=y
  for i in range(n-1):
    if tree[i][0]==x:
      dfs(tree[i][1],y)

for i,j in point:
  dfs(i,j)

ans2=''
for i in range(1,n+1):
  ans2+=str(ans[i])
  if i!=n:
    ans2+=' '

print(ans2)
Problem p02946 (python)

Fixed submission:
a,b=map(int,input().split())
x=[]
for i in range(b-a+1,b+a):
  x.append(str(i))
print(' '.join(x))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
x=[]
for i in range(b-a+1,b+a):
  x.append(i)
print(''.join(x),sep=' ')

Buggy submission (verdict: Runtime Error):
k,x=map(int,input().split())
sum=''
for i in range(x-k+1,k+x):
  sum+=i
print(sum)
Problem p02947 (python)

Fixed submission:
import collections

n=int(input())
lst=[]
ans=0

for i in range(n):
    s=input()
    lst.append(''.join(sorted(s)))

c=collections.Counter(lst)

for i in set(lst):
    x=c[i]

    ans+=x*(x-1)//2


print(ans)

Buggy submission (verdict: Runtime Error):
import collections

n=int(input())
lst=[]
ans=0

for i in range(n):
  s=input()
  s.sort()
  lst+=[s]
  
  c=collections.Counter(s)
  
for i in c.values():
  ans+=i*(i-1)//2
  
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[]
cnt=0
for i in range(n):
  s=input()
  s=sorted(s)
  a.append(s)
b=set(a)
for i in b:
  x=a.count(i)
  if x>0:
    cnt+=x*(x-1)//2
print(cnt)

Buggy submission (verdict: Runtime Error):
def kaijyou(x):
  a=1
  for i in range(x):
    a*=i
    return a

cnt=0
n=int(input())
x=[input() for i in range(n)]
y=set(x)
for i in y:
  cnt+=kaijyou(x.count(i)-1)
print(cnt)
Problem p02952 (python)

Fixed submission:
n=int(input())
if n<=9:
  print(n)
elif n<=99:
  print(9)
elif n<=999:
  print(n-90)
elif n<=9999:
  print(909)
elif n==100000:
  print(90909)
else:
  print(n-9090)

Buggy submission (verdict: Runtime Error):
n=int(input())
if n<=9:
  print(n)
elif n<=99:
  print(9)
elif n<=999:
  print(n-90):
elif n<=9999:
  print(909)
elif n==100000:
  print(90909)
else:
  print(n-9090)