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

Fixed submission:
def resolve():
    import sys
    input = sys.stdin.readline
    n=int(input())
    a=sorted(list(map(int,input().split())))
    ma=a[-1]
    pn=[i for i in range(ma+1)]
    for i in range(2,ma//2+1):
      j=2
      while j*i<=ma:
        pn[j*i]=min(pn[j*i],i)
        j+=1
    chk=[0]*(ma+1)
    for i in a:
      if i==1:
        continue
      x=pn[i]
      chk[x]+=1
      while x!=i:
        while i%x==0:
          i//=x
        x=pn[i]
        chk[x]+=1
    ans=2
    for i in chk[2:]:
      if i==n:
        ans=0
        break
      if i>=2:
        ans=1
    if ans==2:
      print('pairwise coprime')
    elif ans==1:
      print('setwise coprime')
    else:
      print('not coprime')

if __name__ == '__main__':
    resolve()

Buggy submission (verdict: Runtime Error):
def prime_numbers(N):
  A=list(range(2,N+1))
  p=list()
  while A[0]**2<=N:
    tmp=A[0]
    p.append(tmp)
    A=[e for e in A if e%tmp!=0]
  return p+A
 
n=int(input())
a=sorted(list(map(int,input().split())))
prit=prime_numbers(a[-1])
ans=2
for i in prit:
  cnt=0
  for j in a:
    if i>j:
      continue
    if j%i==0:
      cnt+=1
  if cnt==n:
    ans=0
    break
  if cnt>=2:
    ans=1
if ans==2:
  print('pairwise coprime')
elif ans==1:
  print('setwise coprime')
else:
  print('not coprime')

Buggy submission (verdict: Runtime Error):
def prime_numbers(N):
  A=list(range(2,N+1))
  p=list()
  while A[0]**2<=N:
    tmp=A[0]
    p.append(tmp)
    A=[e for e in A if e%tmp!=0]
  return p+A
 
n=int(input())
a=sorted(list(map(int,input().split())))
prit=prime_numbers(a[-1])
ans=2
for i in prit:
  cnt=0
  for j in a:
    if i>j:
      continue
    if j%i==0:
      cnt+=1
  if cnt==n:
    ans=0
    break
  if cnt>=2:
    ans=1
if ans==2:
  print('pairwise coprime')
elif ans==1:
  print('setwise coprime')
else:
  print('not coprime')

Buggy submission (verdict: Runtime Error):
def prime_numbers(N):
  A=list(range(2,N+1))
  p=list()
  while A[0]**2<=N:
    tmp=A[0]
    p.append(tmp)
    A=[e for e in A if e%tmp!=0]
  return p+A

n=int(input())
a=sorted(list(map(int,input().split())))
pri,prit=prime_numbers(a[-1])
ans=2
for i in prit:
  cnt=0
  for j in a:
    if i>j:
      continue
    if j%i==0:
      cnt+=1
  if cnt==n:
    ans=0
    break
  if cnt>=2:
    ans=1
if ans==2:
  print('pairwise coprime')
elif ans==1:
  print('setwise coprime')
else:
  print('not coprime')

Buggy submission (verdict: Runtime Error):
def prime_numbers(N):
  A=list(range(2,N+1))
  p=list()
  while A[0]**2<=N:
    tmp=A[0]
    p.append(tmp)
    A=[e for e in A if e%tmp!=0]
  return p+A

n=int(input())
a=sorted(list(map(int,input().split())))
pri,prit=prime_numbers(a[-1])
ans=2
for i in prit:
  cnt=0
  for j in a:
    if i>j:
      continue
    if j%i==0:
      cnt+=1
  if cnt==n:
    ans=0
    break
  if cnt>=2:
    ans=1
if ans==2:
  print('pairwise coprime')
elif ans==1:
  print('setwise coprime')
else:
  print('not coprime')
Problem p02630 (python)

Fixed submission:
def resolve():
    n=int(input())
    a=list(map(int,input().split()))
    l=[0]*(10**5+1)
    for i in a:
        l[i]+=1
    ans=sum(a)
    q=int(input())
    for i in range(q):
        b,c=map(int,input().split())
        x=l[b]
        ans+=(c-b)*x
        l[c]+=x
        l[b]=0
        print(ans)

if __name__ == '__main__':
    resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    n=int(input())
    a=list(map(int,input().split()))
    l=[0]*(10**5)
    for i in a:
        l[i]+=1
    ans=sum(a)
    q=int(input())
    for i in range(q):
        b,c=map(int,input().split())
        x=l[b]
        ans+=(c-b)*x
        l[c]+=x
        l[b]=0
        print(ans)


if __name__ == '__main__':
    resolve()
Problem p02639 (python)

Fixed submission:
x=list(map(int,input().split()))
for i,j in enumerate(x):
	if j==0:
		print(i+1)
		break

Buggy submission (verdict: Runtime Error):
from numba import jit

@jit(cache = True)
def solve(i,j,a):
    k=False
    sc=0
    for c in a:
        if c>j:
            break
        elif c>j//2 and c<j:
            continue
        elif c==j:
            sc+=1
            if sc>=2:
                k=True
                break
        else:
            if j%c==0:
                k=True
                break
    return k

n=int(input())
a=sorted(list(map(int,input().split())))
ans=0
for i,j in enumerate(a):
    if solve(i,j,a):
        continue
    else:
        ans+=1
print(ans)
Problem p02647 (python)

Fixed submission:
import numpy as np
from numba import jit
@jit(cache = True)
def solve(n,k,A):
    l,r=0,0
    for i in range(k):
        B=np.zeros(n+1,dtype=np.int64)
        for x,y in enumerate(list(A)):
            l=max(0,x-y)
            r=min(n,x+y+1)
            B[l]+=1
            B[r]-=1
        A=np.cumsum(B[:-1])
        if A[A==n].size==n:
            break
    return A
n,k=map(int,input().split())
a=list(map(int,input().split()))
A=np.array(a)
X=solve(n,k,A)
print(*X,sep=' ')

Buggy submission (verdict: Runtime Error):
import numpy as np
from numba import jit

@jit('i2[:](i2,i2,i2[:])',cashe=True)
def solve(n,k,A):
    l,r=0,0
    for i in range(k):
        B=np.zeros(n+1,dtype=np.int64)
        for x,y in enumerate(list(A)):
            l=max(0,x-y)
            r=min(n,x+y+1)
            B[l]+=1
            B[r]-=1
        A=np.cumsum(B[:-1])
        if A[A==n].size==n:
            break
    return A
n,k=map(int,input().split())
a=list(map(int,input().split()))
A=np.array(a)
X=solve(n,k,A)
print(*X,sep=' ')

Buggy submission (verdict: Runtime Error):
import numpy as np
from numba import jit
@jit
def main():
    n,k=map(int,input().split())
    a=list(map(int,input().split()))
    A=np.array(a)
    l,r=0,0
    for i in range(min(41,k)):
        B=np.zeros(n+1,dtype=np.int64)
        for x,y in enumerate(list(A)):
            l=max(0,x-y)
            r=min(n,x+y+1)
            B[l]+=1
            B[r]-=1
        A=np.cumsum(B[:-1])
    print(*A,sep=' ')

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import numpy as np
n,k=map(int,input().split())
a=list(map(int,input().split()))
A=np.array(a)
l,r=0,0
for i in range(k):
    B=np.zeros(n,dtype=np.int64)
    for x,y in enumerate(list(A)):
        l=max(0,x-y)
        r=min(n-1,x+y)
        B[l:r+1]+=1
    A=B
print(*A,sep=' ')
Problem p02690 (python)

Fixed submission:
x=int(input())
for a in range(-118,120):
    for b in range(-118,120):
        if a**5-b**5==x:
            print(a,b)
            exit()

Buggy submission (verdict: Runtime Error):
    x=int(input())
    for a in range(-118,120):
        for b in range(-118,120):
            if a**5-b**5==x:
                print(a,b)
                exit()
Problem p02691 (python)

Fixed submission:
from collections import Counter
n=int(input())
a=list(list(map(int,input().split())))
ma=[i-a[i] for i in range(n)]
r=Counter(ma)
ans=0
for i in range(n):
    ans+=r[i+a[i]]
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(list(map(int,input().split())))
ma=max(a)
l,r=[0]*(ma+n+1),[0]*(ma+n+1)
for i,a in enumerate(a):
    l[i+a]+=1
    if i-a<0:
        continue
    else:
        r[i-a]+=1
ans=0
for a,b in zip(l,r):
    ans+=a*b
print(ans)
Problem p02697 (python)

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

for i in range(M):
    j = i // 2
    if i % 2 == 1:
        print(j+1, M-j)
    else:
        print(M+j+1, 2*M+1-j)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
N=2*m+1
if m%2==0:
    for i in range(m//2):
        print(i+1,m+1-i)
        print(m+2+i,N-i)
else:
    for i in range(m//2):
        print(i+1,m-i)
        print(m+1+i,N-i)
    print(m+1+i+1,N-i-1)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
N=2*m+1
if m%2==0:
    for i in range(m//2):
        print(i+1,m+1-i)
        print(m+2+i,N-i)
else:
    for i in range(m//2):
        print(i+1,m-i)
        print(m+1+i,N-i)
    print(m+1+i+1,N-i-1)
Problem p02721 (python)

Fixed submission:
def main():
    n,k,c=map(int,input().split())
    s=list(input())
    l,r=[0]*(k+1),[0]*(k+1)
    x,i=1,0
    while i<=n-1:
        if s[i]=='o':
            l[x]=i+1
            i+=c+1
            x+=1
            if x==k+1:
                break
        else:
            i+=1
    x,i=k,n-1
    while 0<=i:
        if s[i]=='o':
            r[x]=i+1
            x-=1
            i-=c+1
            if x==0:
                break
        else:
            i-=1
    for i in range(1,k+1):
        if l[i]==r[i]:
            print(l[i])

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    n,k,c=map(int,input().split())
    s=list(input())
    l=[0]*(k+1)
    r=[0]*(k+1)
    x=0
    i=0
    while i<=n-1:
        if s[i]=='o':
            x+=1
            l[x]=i+1
            i+=c+1
            if x==k:
                break
        else:
            i+=1
    i=n-1
    while 0<=i:
        if s[i]=='o':
            r[x]=i+1
            x-=1
            i-=c+1
            if x==1:
                break
        else:
            i-=1
    for i in range(1,k+1):
        if l[i]==r[i]:
            print(l[i])

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    n,k,c=map(int,input().split())
    s=list(input())
    l=[0]*(k+1)
    r=[0]*(k+1)
    x=0
    i=0
    while i<=n-1:
        if s[i]=='o':
            x+=1
            l[x]=i+1
            i+=k+1
            if x==k:
                break
        else:
            i+=1
    i=n-1
    while 0<=i:
        if s[i]=='o':
            r[x]=i+1
            x-=1
            i-=k+1
            if x==1:
                break
        else:
            i-=1
    for i in range(1,k+1):
        if l[i]==r[i]:
            print(l[i])

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    n,k,c=map(int,input().split())
    s=list(input())
    l=[0]*(k+1)
    r=[0]*(k+1)
    x=0
    i=0
    while i<=n-1:
        if s[i]=='o':
            x+=1
            l[x]=i+1
            i+=k+1
            if x==k:
                break
        else:
            i+=1
    print(l)
    i=n-1
    while 0<=i:
        if s[i]=='o':
            r[x]=i+1
            x-=1
            i-=k+1
            if x==1:
                break
        else:
            i-=1
    print(r)
    for i in range(1,k+1):
        if l[i]==r[i]:
            print(l[i])

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

Fixed submission:
import sys
input = sys.stdin.readline

def main():
    n,r=map(int,input().split())
    if n>=10:
        print(r)
    else:
        print(int(100*(10-n)+r))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

def main():
    def calc(n, mod):
        f = 1
        for m in range(1, n + 1):
            f *= m
            f %= mod
        fn = f
        inv = pow(f, mod - 2, mod)
        invs = [1] * (n + 1)
        invs[n] = inv
        for m in range(n, 1, -1):
            inv *= m
            inv %= mod
            invs[m - 1] = inv 
        return fn, invs

    mod = 10**9+7
    n,a,b=map(int,input().split())
    ans=0
    fn,invs=calc(n,mod)
    for i in range(1,n+1):
        if i==a or i==b:
            continue
        else:
            ans+=(invs[i]*invs[n-i])%mod
    print((fn*ans)%mod)

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

Fixed submission:
import sys
input = sys.stdin.readline
import numpy as np

def main():
    N, K = map(int,input().split())
    A = np.sort(np.array(list(map(int, input().split())), np.int64))
    z = A[A == 0]
    p = A[A > 0]
    n = A[A < 0]
    
    def count_func(x):
        cnt = 0
        if x >= 0:
            cnt += len(z) * N
        cnt += np.searchsorted(A, x // p, side='right').sum()
        cnt += (N - np.searchsorted(A, -(-x // n), side='left')).sum()
        cnt -= np.count_nonzero(A * A <= x)
        assert cnt % 2 == 0
        return cnt // 2
    
    l = -10 ** 18
    r = 10 ** 18
    while l + 1 < r:
        x = (l + r) // 2
        if count_func(x) >= K:
            r = x
        else:
            l = x
    
    print(r)
    
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
import numpy as np

def main():
    N, K = map(int,input().split())
    A = np.sort(np.array(list(map(int, input().split())), np.int64))
    z = A[A == 0]
    p = A[A > 0]
    n = A[A < 0]
    
    def count_func(x):
        cnt = 0
        if x >= 0:
            cnt += len(z) * N
        cnt += np.searchsorted(A, x // p, side='right').sum()
        cnt += (N - np.searchsorted(A, -(-x // n), side='left')).sum()
        cnt -= np.count_nonzero(A * A <= x)
        assert cnt % 2 == 0
        return cnt // 2
    
    l = -10 ** 18
    r = 10 ** 18
    while l + 1 < r:
        x = (l + r) // 2
        if count_func(x) >= K:
            r = x
        else:
            l = x
    
    print(r)
    
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

def main():
    n,k=map(int,input().split())
    a=list(map(int,input().split()))
    ans=[0]*(int(n*(n-1)/2))
    cnt=0
    for i in range(n):
        for j in range(i,n):
            if i==j:
                continue
            else:
                ans[cnt]=a[i]*a[j]
            cnt+=1
    ans.sort()
    print(ans[k-1])
    
if __name__ == '__main__':
    main()
Problem p02787 (python)

Fixed submission:
def main():
    h, n = map(int, input().split())
    ab = [list(map(int, input().split())) for _ in range(n)]
    dp =[0]*(h+max(a for a,b in ab))
    for i in range(1, h+1):
        dp[i] = min(dp[i-a]+b for a,b in ab)
    print(dp[h])
      
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    h, n = map(int, input().split())
    ab = [list(map(int, input().split())) for _ in range(n)]
    dp =[0]*(h+max(ab[0:n][0]))
    for i in range(1, h+1):
        dp[i] = min(dp[i-a]+b for a,b in ab)
    print(dp[h])
      
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
h, n = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
dp =[0]*(h+max(ab[0:n][0]))
for i in range(1, h+1):
  dp[i] = min(dp[i-a]+b for a,b in ab)
print(dp[h])

Buggy submission (verdict: Runtime Error):
h, n = map(int, input().split())
2.ab = [list(map(int, input().split())) for _ in range(n)]
3.dp =[0]*(h+max(ab[0:n][0]))
4.for i in range(1, h+1):
5.  dp[i] = min(dp[i-a]+b for a,b in ab)
6.print(dp[h])

Buggy submission (verdict: Runtime Error):
h, n = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
dp =[0]*(h+max(ab[0:n][1]))
for i in range(1, h+1):
  dp[i] = min(dp[i-a]+b for a,b in ab)
print(dp[h])
Problem p02795 (python)

Fixed submission:
h=int(input())
w=int(input())
n=int(input())
flg,cnt,pn=0,0,0
mh,mw=h,w
hcnt,wcnt=h,w
while pn<n:
  if mh==mw:
    if hcnt>wcnt:
      flg=0
    else:
      flg=1
  elif mh>mw:
    flg=1
  else:
    flg=0
  if flg==1:
    pn+=mh
    wcnt-=1
    mw-=1
    cnt+=1
  else:
    pn+=mw
    hcnt-=1
    mh-=1
    cnt+=1    
print(cnt)

Buggy submission (verdict: Runtime Error):
n=int(input())
x,l,dcnt=[0]*n,[0]*n,[0]*n
xlr=[[0]*2 for i in range(n)]
for i in range(n):
  a,b=map(int,input().split())
  x[i],l[i]=a,b
  xlr[i]=[a-b,a+b]
xlr.sort()
for i in range(n-1):
  chk=xlr[i][1]
  cnt=0
  for j in range(i+1,n):
    if xlr[j][0]<chk:
      cnt+=1
    else:
      break
  dcnt[i]=cnt
cnt=0
for i in range(1,n+1):
  if dcnt[n-i]>0:
    dcnt[n-i]=0
    cnt+=1
    for j in range(n-i):
      if dcnt[n-i-j-1]>j:
        dcnt[n-i-j-1]-=1
print(n-cnt)
Problem p02801 (python)

Fixed submission:
a='abcdefghijklmnopqrstuvwxyz'
s=input()
cnt=0
while s!=a[cnt]:
	cnt+=1
print(a[cnt+1])

Buggy submission (verdict: Runtime Error):
def main():
    def pre(n,mod):
        an=[1]*(n+1)
        a=1
        for i in range(1,n+1):
            a=(a*i)%mod
            an[i]=a
        b=pow(a,mod-2,mod)
        bs=[1]*(n+1)
        bs[n]=b
        for i in range(n,1,-1):
            b=b*i%mod
            bs[i-1]=b
        return an,bs

    n,k=map(int,input().split())
    a=sorted(list(map(int,input().split())))
    mod=10**9+7
    an,bs=pre(n,mod)
    ans=0
    for i in range(k,n+1):
        for j in range(0,n-i+1):
            s=a[i+j-1]-a[j]
            s=(s*an[i-2]*bs[k-2]*bs[i-k])%mod
            ans=(ans+s)%mod
    print(ans)

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

Fixed submission:
import sys
input = sys.stdin.readline

def main():
    n,m=map(int,input().split())
    w=[0]*(n+1)
    a=[0]*(n+1)
    for i in range(m):
        p,s=map(str,input().split())
        p=int(p)
        if a[p]==0:
            if s=='WA':
                w[p]+=1
            else:
                a[p]=1
    wa=0
    for i in range(1,n+1):
        wa=wa+a[i]*w[i]
    print(sum(a),wa)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
cnt=0
acc=0
ac={}
for i in range(m):
	p,s= map(str,input().split())
	if ac[p]==0:
		if s=='AC':
			acc+=1
			ac[p]=1
		else:
			cnt+=1
print(acc,cnt)

Buggy submission (verdict: Runtime Error):
n,m= map(int,input().split())
cnt=0
acc=0
ac=[0]*n
for i in range(m):
	p,s= map(str,input().split())
	if ac[int(p)]==0:
		if s=='AC':
			acc+=1
			ac[int(p)]=1
		else:
			cnt+=1
print(acc,cnt)

Buggy submission (verdict: Runtime Error):
n,m= map(int,input().split())
cnt=0
acc=0
ac=[0]*n
for i in range(m):
	p,s= map(str,input().split())
	if ac[int(p)]==0:
		if s=='AC':
			acc+=1
			ac[int(p)]=1
		else:
			cnt+=1
print(acc,cnt)
Problem p02817 (python)

Fixed submission:
s,t=map(str,input().split())
print(t+s)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

def main():
    n,m=map(int,input().split())
    a=sorted(list(map(int,input().split())))
    a.reverse()
    l,r=2*a[-1],2*a[0]
    x=(l+r)//2
    while l+1<r:
        cnt=0
        for A in a:
            for B in a:
                if A+B>=x:
                    cnt+=1
                else:
                    break
        if cnt>=m:
            l=x
        else:
            r=x
        x=(l+r)//2
    s,cnt=0,0
    for A in a:
        for B in a:
            if A+B>=l:
                cnt+=1
                s+=A+B
            else:
                break
    print(s+(m-cnt)*l)
    
if __name__ == '__main__':
    main()
Problem p02821 (python)

Fixed submission:
import sys
input = sys.stdin.readline
from bisect import bisect, bisect_left
from itertools import accumulate

def main():
    def check(x):
        count = 0
        for a in aaa:
            if x <= a:
                count += n
            else:
                count += n - bisect_left(aaa, x - a)
        return count >= m
    
    
    n, m = map(int, input().split())
    aaa = list(map(int, input().split()))
    aaa.sort()
    acc = [0] + list(accumulate(aaa))
    sum_a = acc[-1]
    
    l, r = 0, 200001
    while l + 1 < r:
        mid = (l + r) // 2
        if check(mid):
            l = mid
        else:
            r = mid
    
    # 合計がlより大きい組み合わせの和と組数を求める→Mに足りない分だけ合計がlの組を採用
    ans = 0
    count = 0
    for a in aaa:
        if l <= a:
            ans += sum_a + a * n
            count += n
        else:
            omit = bisect(aaa, l - a)
            if omit < n:
                ans += sum_a - acc[omit] + a * (n - omit)
                count += n - omit
    ans += l * (m - count)
    print(ans)
    
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

def main():
    n,m=map(int,input().split())
    a=sorted(list(map(int,input().split())))
    a.reverse()
    l,r=2*a[-1],2*a[0]
    x=(l+r)//2
    while l+1<r:
        s=0
        cnt,cnt2=0,0
        for i,A in enumerate(a):
            if A>=x:
                cnt+=2*(n-i)
                s+=2*(sum(a[i+1:])+(n-i-1)*A)+A*2
                cnt2+=1
            else:
                if A*2>=x:
                    cnt2+=1
                    s+=A*2
                for B in a[i+1:]:
                    if A+B>=x:
                        cnt+=2
                        s+=2*(A+B)
                    else:
                        break
        cnt+=cnt2
        if cnt>=m:
            l=x
        else:
            r=x
        x=(l+r)//2
    if cnt>m:
        print(s-(m-cnt)*l)
    else:
        print(s)
    
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

def main():
    n,m=map(int,input().split())
    a=sorted(list(map(int,input().split())))
    a.reverse()
    l,r=2*a[-1],2*a[0]
    x=(l+r)//2
    while l+1<r:
        cnt=0
        s=0
        for A in a:
            for B in a:
                if A+B>=x:
                    cnt+=1
                    s+=A+B
                else:
                    break
        if cnt>=m:
            l=x
        else:
            r=x
        x=(l+r)//2
    print(s+(m-cnt)*l)
    
if __name__ == '__main__':
    main()
Problem p02841 (python)

Fixed submission:
m1,d1=map(int,input().split())
m2,d2=map(int,input().split())
if m1==m2:
  print('0')
else:
  print('1')

Buggy submission (verdict: Runtime Error):
N=int(input())
if int((N//1.08)*1.08)==N:
  print(int(N//1.08))
elif int((N//1.08+1)*1.08)==N:
  print(int(N//1.08+1))
else:
  print(':(')
Problem p02845 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
c=[0]*(n+1)
c[0]=3
cnt=1
for i in a:
  cnt=cnt*c[i]%1000000007
  c[i]-=1
  c[i+1]+=1
print(cnt)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
c=[0]*n
c[0]=3
cnt=1
for i in a:
  cnt=cnt*c[i]%1000000007
  c[i]-=1
  c[i+1]+=1

print(cnt)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
c=[0]*n
c[0]=3
cnt=1
for i in a:
  cnt*=c[i]
  c[i]-=1
  c[i+1]+=1

print(cnt%1000000007)
Problem p02882 (python)

Fixed submission:
import math
a,b,x=map(int,input().split())
v=a*a*b
if x>v/2:
  print(math.degrees(math.atan(2*(b-x/(a**2))/a)))
else:
  print(math.degrees(math.atan(a*b*b/(2*x))))

Buggy submission (verdict: Runtime Error):
import math
a,b,x=map(int,input().split())
c=2*x/(a*b)
if (b*a**2)/2<x:
  print(90-math.atan(a/(2*(b-x/(a**2))))/(2*math.pi)*360)
else:
  print(math.atan(b/c)/(2*math.pi)*360)
Problem p02886 (python)

Fixed submission:
n=int(input())
d=list(map(int,input().split()))
s=[0]*int(n*(n-1)/2)
cnt=0
for i in range(n):
  for j in range(i+1,n):
    s[cnt]=d[i]*d[j]
    cnt+=1
print(sum(s))

Buggy submission (verdict: Runtime Error):
7
5 0 7 8 3 3 2

Buggy submission (verdict: Runtime Error):
n=int(input())
d=list(map(int,input().split()))
s=[0]*n
cnt=0
for i in range(n):
  for j in range(i+1,n):
    s[cnt]=d[i]*d[j]
    cnt+=1
print(sum(s))
Problem p02888 (python)

Fixed submission:
import sys
input = sys.stdin.readline
from bisect import bisect_left

def main():
    n=int(input())
    l=sorted(list(map(int,input().split())))
    ans=0
    for i in range(n-2):
        a=l[i]
        for j in range(i+1,n-1):
            ans+=bisect_left(l,a+l[j])-j-1
    print(ans)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import numpy as np
n=int(input())
l=list(map(int,input().split()))
l.sort()
L=np.array(l)
cnt=0
for i in range(n-2):
  for j in range(i+1,n-1):
    cnt+=np.count_nonzero(L[j+1:]<L[i]+L[j])
print(cnt)