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

Fixed submission:
N = int(input())
S, T = input().split()
A = ''
for a in range(N):
  A += S[a]+T[a]
print(A)

Buggy submission (verdict: Runtime Error):
N = int(input())
S, T = input().split()
A = ''
for a in range(N):
  A.append(S[a]+T[a])
print(A)
Problem p02848 (python)

Fixed submission:
A=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O',
   'P','Q','R','S','T','U','V','W','X','Y','Z']
N=int(input())
x=input()
X=[j for j in x]
for i in range(0,len(X)):
  n=(A.index(X[i])+N)%26
  X[i]=A[n]
Y=''
for i in X:
  Y+=i
print(Y)

Buggy submission (verdict: Runtime Error):
A=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O',
   'P','Q','R','S','T','U','V','W','X','Y','Z']
N=int(input())
X=input()
for i in range(0,len(X)-1):
  n=(A.index(X[i])+N)%26
  X[i]=A[n]
print(X)

Buggy submission (verdict: Runtime Error):
A=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O',
   'P','Q','R','S','T','U','V','W','X','Y','Z']
N=int(input())
X=input()
for i in range(0,len(X)-1):
  n=(A.index(i)+N)%26
  X[i]=A[n]
print(X)

Buggy submission (verdict: Runtime Error):
A=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O',
   'P','Q','R','S','T','U','V','W','X','Y','Z']
N=int(input())
X=input()
for i in range(0,len(X)):
  n=(A.index(i)+N)%26
  X[i]=A[n]
print(X)
Problem p02934 (python)

Fixed submission:
N=int(input())
S=0
A=list(map(int,input().split()))
for i in A:S+=1/i
print(1/S)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=0
A=list(map(int,input().split()))
for i in range(N):
  S += 1/i
print(1/S)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=0
A=list(map(int,input().split()))
for i in range(N):S+=1/i
print(1/S)
Problem p02953 (python)

Fixed submission:
N=int(input())
L=list(map(int,input().split()))
M=L[::-1]
for i in range(N-1):
    if M[i]+1<M[i+1]:
        print('No')
        break
    elif M[i]+1==M[i+1]:
        M[i+1]=M[i]
else:print('Yes')

Buggy submission (verdict: Runtime Error):
N=int(input())
L=list(int(input()) for _ in range(N))
M=L[::-1]
for i in range(N-1):
    if M[i]+1<M[i+1]:
        print('No')
        break
    elif M[i]+1==M[i+1]:
        M[i+1]=M[i]
else:print('Yes')

Buggy submission (verdict: Runtime Error):
N=int(input())
L=list(int(input()) for _ in range(N))
M=L[::-1]
for i in range(N-1):
    if M[i]+1<M[i+1]:
        print('No')
        break
    elif M[i]+1=M[i+1]:
        M[i+1]=M[i]
else:print('Yes')
Problem p03085 (python)

Fixed submission:
b=input()
print('A' if b=='T' else 'T' if b=='A' else 'G' if b=='C' else 'C')

Buggy submission (verdict: Runtime Error):
b=int(input())
print('A' if b=='T' else 'T' if b=='A' else 'G' if b=='C' else 'C')
Problem p03102 (python)

Fixed submission:
N,M,C=map(int,input().split())
B=list(map(int,input().split()))
count=0
for i in range(N):
    A=list(map(int,input().split()))
    p=C
    for j in range(M):p+=A[j]*B[j]
    if p>0:count+=1
print(count)

Buggy submission (verdict: Runtime Error):
N,M,C=map(int,input().split())
B=list(map(int,input().split()))
count=0
for i in range(N):
  A=list(map(int, input().split()))
  p=C
  for j in range(M):
    P+=A[j]*B[j]
    if p>0:
      count+=1
print(count)
Problem p03126 (python)

Fixed submission:
n,m=map(int, input().split())
A=set(range(1, m+1))
for _ in range(n):
  a,*b=map(int, input().split())
  A = A & set(b)
print(len(A))

Buggy submission (verdict: Runtime Error):
n,m=map(int, input().split())
A=set(range(1, m+1))
for _ in range(n):
  a,*b=map(int, input().split())
  A = A & set(*b)
print(len(A))
Problem p03211 (python)

Fixed submission:
S=input()
print(min(abs(753-int(S[i:i+3])) for i in range(len(S)-2)))

Buggy submission (verdict: Runtime Error):
S=input()
print(min(abs(753-int(S[i,i+3])) for i in range(len(S)-2)))
Problem p03261 (python)

Fixed submission:
N=int(input())
A=list(input()for i in range(N))
if len(A)==len(set(A)):
    if all(A[i][-1]==A[i+1][0] for i in range(N-1)):
        print('Yes')
    else:print('No')
else:print('No')

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(input()for i in range(N))
if len(A)==len(set(A)):
    if all(A[i][-1]==A[i+1][0]) for i in range(N-2):
        print('Yes')
    else:print('No')
else:print('No')

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(input()for i in range(N))
if len(A)==len(set(A)):
    if all(A[i][-1]==A[i+1][0]) for i in range(N-1):
        print('Yes')
    else:print('No')
else:print('No')

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(input()for i in range(N))
if len(A)==len(set(A):
    if all(A[i][-1]==A[i+1][0]) for i in range(N-1):
        print('Yes')
    else:print('No')
else:print('No')
Problem p03292 (python)

Fixed submission:
a,b,c=sorted(map(int, input().split()))
print(c-a)

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

Buggy submission (verdict: Runtime Error):
a,b,c=sorted(map(int, input().split())
print(a-2*b+c)
Problem p03338 (python)

Fixed submission:
N=int(input())
S=input()
print(max(len(set(S[:i])&set(S[i:])) for i in range(N)))

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
max(len(set(S[:i])&set(S[i:])) for i in range(1,len(S)-2))

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
max(len((S[:i]&S[i:])) for i in range(1,len(S)-2))

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
max(sum(S[:i]&S[i:]) for i in range(1,len(S)-2))
Problem p03352 (python)

Fixed submission:
A=int(input())
B=[1]*8
for i in range(2,10):
  for j in range(A+1):
    if j**i <= A:
      B[i-2]= j**i
    else:break
print(max(B))

Buggy submission (verdict: Runtime Error):
A=int(input())
B=[1]*8
for i in range(2,10):
  for j in range(A+1):
    if j**i <= A:
      B[i-2]= j**i
    else:break
B=B.sort()
print(B[-1])

Buggy submission (verdict: Runtime Error):
A=int(input())
B=[1]*8
for i in range(2,10):
  for j in range(A+1):
    if j**i <= A:
      B[i-2]= j**i
    else:break
print(B.sort()[-1])

Buggy submission (verdict: Runtime Error):
A=int(input())
B=[1]*8
for i in range(2:10):
  for j in range(A+1):
    if j**i <= A:
      B[i-2]= j**i
    else:break
print(B.sort()[-1])

Buggy submission (verdict: Runtime Error):
A=int(input())
B=[1]*9
for i in range(1:10):
  for j in range(A+1):
    if j**i <= A:
      B[i]= j**i
    else:break
print(B.sort()[-1])
Problem p03359 (python)

Fixed submission:
a,b=map(int,input().split())
print(a-1+(a<=b))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
print(sum(a-1+(a<=b)))
Problem p03370 (python)

Fixed submission:
n,x=map(int,input().split())
a=list(int(input()) for _ in range(n))
print(n+((x-sum(a))//min(a)))

Buggy submission (verdict: Runtime Error):
n,x=map(int,input().split())
a=[int(input()) for _ range(n)]
print(n+((x-sum(a))//min(a)))

Buggy submission (verdict: Runtime Error):
n,x=map(int,input().split())
a=list(int(input()) for _ range(n))
print(n+((x-sum(a))//min(a)))

Buggy submission (verdict: Runtime Error):
n,x=map(int,input().split())
a=list(int(input()) for _ range(n))
print(n+(x-sum(a))//min(a))

Buggy submission (verdict: Runtime Error):
n,x=map(int,input().split.())
a=list(int(input()) for _ range(n))
print(n+(x-sum(a))//min(a))

Buggy submission (verdict: Runtime Error):
n,x=map(int,input().suplit.())
a=list(int(input()) for _ range(n))
print(n+(x-sum(a))//min(a))
Problem p03378 (python)

Fixed submission:
n,m,x=map(int,input().split())
s=sum(int(i)<x for i in input().split())
print(min(s,m-s))

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
d=list(map(int, input().split())
d.append(c)
d.sort()
print(min(d.index(c), len(d)-d.index(c)-1))
Problem p03399 (python)

Fixed submission:
a,b,c,d=[int(input()) for _ in range(4)]
print(min(a,b)+min(c,d))

Buggy submission (verdict: Runtime Error):
a,b,c,d=[int(input()) for_ in range(4)]
print(min(a,b)+min(c,d))
Problem p03448 (python)

Fixed submission:
a=int(input())
b=int(input())
c=int(input())
x=int(input())
s=50*c
print(len([1 for i in range(a+1) for m in range(b+1) if 0<=x-500*i-100*m<=s]))

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
x=int(input())
s=50*c
print(len[1 for i in range(a+1) for m in range(b+1) if 0<=x-500*i+100*m<=s])

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
x=int(input())
s=50*c
print(len[1 for i in range(a+1) for m in range(b+1) if 0<=x-500*i+100*m<=s ])

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
x=int(input())
s=50*c
print(len[1 for i in range(a+1) for m in range(b+1) if 0<<x-500*i+100*m<<s ])

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
x=int(input())
s=50*c
print(len[1 if 0<<x-500*i+100*m<<s for i in range(a+1) for m in range(b+1)])
Problem p03486 (python)

Fixed submission:
s=sorted(input())
t=sorted(input())[::-1]
A=True
for i in range(min(len(s),len(t))):
    if s[i]<t[i]:
        A = True
        break
    elif s[i]>t[i]:
        A = False
        break
    else:
        if len(s)<len(t): A=True
        else:A= False
print('Yes' if A else 'No')

Buggy submission (verdict: Runtime Error):
s=list(list(i for i in input()).sort())
t=list(list(i for i in input()).sort()(reverse=True))
A=True
for i in range(min(len(s),len(t))):
    if s[i]<t[i]:
        A = True
    elif s[i]>t[i]:
        A = False
        break
    else:
        if len(s)<len(t): A=True
        else:A= False
print('Yes' if A else 'No')

Buggy submission (verdict: Runtime Error):
s=[i for i in input()].sort()
t=[i for i in input()].sort()(reverse=True)
A=True
for i in range(min(len(s),len(t))):
    if s[i]<t[i]:
        A = True
    elif s[i]>t[i]:
        A = False
        break
    else:
        if len(s)<len(t): A=True
        else:A= False
print('Yes' if A else 'No')

Buggy submission (verdict: Runtime Error):
s=list(input().split()).sort()
t=list(input().split()).sort()(reverse=True)
A=True
for i in range(min(len(s),len(t))):
    if s[i]<t[i]:
        A = True
    elif s[i]>t[i]:
        A = False
        break
    else:
        if len(s)<len(t): A=True
        else:A= False
print('Yes' if A else 'No')
Problem p03548 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c=map(int, input().split())
print((a-b-2*c)//(b+C)+1)
Problem p03607 (python)

Fixed submission:
N=int(input())
S=set()
for i in range(N):
    S^={input()}
print(len(S))

Buggy submission (verdict: Runtime Error):
N=int(input())
S={}
for i in range(N):
    S=S^{input()}
print(len(S))
Problem p03730 (python)

Fixed submission:
a,b,c=map(int,input().split())
ans='NO'
for i in range(1,b+1):
  if (i*a)%b==c:
    ans='YES'
    break
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
for i in range(1,b+1):
  if (i*a)%b==c:
    print('YES')
  break
print('NO')
a,b,c=map(int,input().split())
for i in range(b):
  if (i*a)%b==c:
    print('YES')
    break
print('NO')

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
for i in range(1,b+1):
  if (i*a)%b==c:
    print('YES')
    break
print('NO')
a,b,c=map(int,input().split())
for i in range(b):
  if (i*a)%b==c:
    print('YES')
    break
print('NO')
提出情報

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
for i in range(B):
  if (i*a)%b==c:
    print('YES')
    break
print('NO')

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
for i in range(0:B):
  if (i*a)%b==c:
    print('YES')
    break
print('NO')
Problem p03860 (python)

Fixed submission:
A = list(input().split())
print(A[0][0]+A[1][0]+A[2][0])

Buggy submission (verdict: Runtime Error):
A = list(input().split)
B=''
for a in A:
  B += a[0].upper()
print(B)
Problem p02573 (python)

Fixed submission:
from sys import setrecursionlimit

def find(par,i):
    if par[i]<0:
        return i
    par[i] = find(par,par[i])
    return par[i]

def unite(par,i,j):
    ri = find(par,i)
    rj = find(par, j)
    if ri==rj:
        return
    par[rj] += par[ri]
    par[ri] = rj
    
setrecursionlimit(10**6)
n,m = map(int,input().split())

parent = [-1]*n
for _ in range(m):
    a,b = map(lambda x:int(x)-1,input().split())
    unite(parent,a,b)
    
print(-min(parent))

Buggy submission (verdict: Runtime Error):
from sys import setrecursionlimit

def find(par,i):
    if par[i]<0:
        return i
    par[i] = find(par,par[i])
    return par[i]

def unite(par,i,j):
    ri = find(par,i)
    rj = find(par, j)
    if ri==rj:
        return
    par[rj] += par[ri]
    par[ri] = rj
    
setrecursionlimit(10**6)
n,m = map(int,input().split())

parent = [-1]*n
for _ in range(m):
    a,b = map(lambda x:int(x)-1,input().split())
    unite(parent,a,b)
    print(parent)
    

print(-min(parent))
Problem p03211 (python)

Fixed submission:
S = list(input())

ans = 753

for i in range(len(S)-2):
    sa = abs(753-(int(S[i])*100 + int(S[i+1])*10 + int(S[i+2])))
    ans = min(sa,ans)
             
print(ans)

Buggy submission (verdict: Runtime Error):
S = list(input())

ans = 753

for i in range(len(S)-2):
    sa = abs(753-(int(S[i])*100 + int(S[i+1])*10 + int(S[i+2])))
    ans = min(sa,ans)
             
print(ans
Problem p03282 (python)

Fixed submission:
s = input()
k = int(input())

ans = 1
for i in range(min(k,len(s))):
    if s[i]!='1':
        ans = int(s[i])
        break
            
print(ans)

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

if s[0]!='1':
    ans = int(s[0])
else:
    for i in range(min(k,len(s))):
        if s[i]!='1':
            ans = int(s[i])
            break
            
print(ans)
Problem p03471 (python)

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

flag = 0
for x in range(N+1):
    if flag > 0:
        break
    for y in range(N-x+1):
        z = N-x-y
        if 10000*x+5000*y+1000*z == Y and flag == 0:
            flag+=1
            print(x,y,z)
            break
            
if flag == 0:
    print('-1 -1 -1')

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

flag = 0
for x in range(N+1):
    if flag > 0:
        break
    for y in range(N-x+1):
        if 10000*x+5000*y+1000*z == Y and flag == 0:
            z = N-x-y
            flag+=1
            print(x,y,z)
            break
            
if flag == 0:
    print('-1 -1 -1')

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

flag = 0
for x in range(0,N+1):
    for y in range(0,N-x+1):
        if 10000*x+5000*y+1000*z == Y and flag == 0:
            z = N-x-y
            flag+=1
            print(x,y,z)
            break
            
if flag == 0:
    print('-1 -1 -1')

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

flag = 0
for x in range(0,N+1):
    if flag > 0:
        break
    for y in range(0,N-x+1):
        if 10000*x+5000*y+1000*z == Y and flag == 0:
            z = N-x-y
            flag+=1
            print(x,y,z)
            break
            
if flag == 0:
    print('-1 -1 -1')

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

flag = 0
for x in range(0,N+1):
    if flag > 0:
        break
    for y in range(0,N-x+1):
        if 10000*x+5000*y+1000*z == Y and flag == 0:
            z = N-x-y
            flag+=1
            print(x,y,z)
            break
            
if flag == 0:
    print('-1 -1 -1')
Problem p03658 (python)

Fixed submission:
n, k = map(int, input().split())
l = list(map(int, input().split()))
a = 0
	
l.sort(reverse = True)

for i in range(k):
	a += l[i]
	
print(a)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
l = list()
for _ in range(n):
	l.append(int(input()))
	
l.sort(reverse = True)

for i in range(k):
	a += l[i]
	
print(a)
Problem p02616 (python)

Fixed submission:
N,K=map(int,input().split())
A=list(map(int,input().split()))
A.sort()
a,b,i=0,1,0
mod=10**9+7
ans=1
while i<K-1:
  if A[a]*A[a+1]>A[-b]*A[-b-1]:
    ans*=A[a]*A[a+1]
    ans%=mod
    a+=2
    i+=2
  else:
    ans*=A[-b]
    ans%=mod
    b+=1
    i+=1
if i==K-1:
  ans*=A[-b]
  ans%=mod
if A[-1]<0 and K%2==1:
  ans=1
  for i in A[N-K:]:
    ans*=i
    ans%=mod
print(ans%mod)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
A=list(map(int,input().split()))
A.sort(reverse=True,key=lambda x:abs(x))
a=[]
b=[]
c=0
mod=10**9+7
ans=1
for i in range(N):
  if A[i]<0:
    c+=1
    b.append(A[i])
  else:
    a.append(A[i])
if K==N:
  for i in range(N):
    ans*=A[i]
    ans%=mod
else:
  if c==N and K%2==1:
    for i in range(N-1,N-1-K,-1):
      ans*=A[i]
      ans%=mod
  else:
    d,e=0,0
    for i in range(K):
      ans*=A[i]
      if A[i]<0:
        d+=1
      else:
        e+=1
    if ans<0:
      bns=ans//b[d-1]*a[e]
      cns=ans//a[e-1]*b[d]
      ans=max(bns,cns)
      ans%=mod
print(ans)
Problem p02618 (python)

Fixed submission:
D=int(input())
c=list(map(int,input().split()))
s=[list(map(int,input().split())) for _ in range(D)]
for i in range(D):
  a=10**9
  b=0
  for j in range(26):
    if a>=(s[i][j]-c[j]*(D-i-1)):
      a=s[i][j]-c[j]*(D-i-1)
      b=j
  print(j+1)

Buggy submission (verdict: Runtime Error):
D=int(input())
c=list(map(int,input().split()))
s=[list(map(int,input().split())) for _ in range(D)]
a=0
c=0
for i in range(26):
  b=0
  for j in range(D):
    b+=s[i][j]
  b-=c[i]*(D-1)
  if a<=b:
    c=i
for i in range(D):
  if i!=D-1:
    print(c+1)
  else:
    p=0
    q=0
    for j in range(26):
      if p<=s[D-1][j]:
        p=s[D-1][j]
        q=j
    print(j+1)
Problem p02631 (python)

Fixed submission:
def main():
  N=int(input())
  a=list(map(int,input().split()))
  ans=0
  for i in range(N):
    ans=ans^a[i]
  for i in range(N):
    print(ans^a[i],end=' ')
if __name__=='__main__':
  main()

Buggy submission (verdict: Runtime Error):
def main():
  N=int(input())
  a=list(map(int,input().split()))
  p=max(a)
  m=len(bin(p))-2
  for i in range(N):
    b=len(bin(a[i]))-2
    ans=0
    for j in range(b):
      if a[i]>>j&1==1:
        if j==m-1 or j==0:
          ans+=pow(2,j)
      else:
        if j==m-1 or j==0:
          continue
        ans+=pow(2,j)
    print(ans,end=' ')
if __name__=='__main__':
Problem p02640 (python)

Fixed submission:
X,Y=map(int,input().split())
if Y-2*X>=0 and (Y-2*X)%2==0:
  a=int((Y-2*X)//2)
  if X-a>=0:
    print('Yes')
  else:
    print('No')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s=list(map(int,input().split()))
if Y-2*X>=0 and (Y-2*X)%2==0:
  a=int((Y-2*X)//2)
  if X-a>=0:
    print('Yes')
  else:
    print('No')
else:
  print('No')
Problem p02697 (python)

Fixed submission:
N,M=map(int,input().split())
if N%2==1:
  for i in range(M):
    print(i+1,N-i)
else:
  middle=int((M+1)/2)
  for i in range(middle):
    print(i+1,N-i)
  for j in range(middle,M):
    print(j+2,N-j)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
if N%2==1:
  for i in range(M):
    print(i+1,N-i)
else:
  middle=((M+1)/2)
  for i in range(middle):
    print(i+1,N-i)
  for j in range(middle,M):
    print(j+2,N-j)
Problem p02700 (python)

Fixed submission:
s=list(map(int,input().split()))
a=s[0]
b=s[2]
for i in range(200):
  if a<=0:
    break
  if b<=0:
    break
  b=b-s[1]
  a=a-s[3]
if a<=0:
  if b<=0:
    print('Yes')
  else:
    print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
s=list(map(int,input().split()))
a=s[0]
b=s[2]
c=0
for i in range():
  if a<=0 or b<=0:
    break
  if c==0:
    b=b-s[1]
    c=1
  else:
    a=a-s[3]
if a<=0:
  print('No')
else:
  print('Yes')
Problem p02748 (python)

Fixed submission:
s=list(map(int,input().split()))
t=list(map(int,input().split()))
u=list(map(int,input().split()))
v=[list(map(int,input().split())) for i in range(s[2])]
a=10**6
d=0
e=0
for i in range(s[2]):
  d=v[i][0]-1
  e=v[i][1]-1
  b=t[d]+u[e]-v[i][2]
  a=min(a,b)
f=min(t)
e=min(u)+f
a=min(a,e)
print(a)

Buggy submission (verdict: Runtime Error):
s=list(map(int,input().split()))
t=list(map(int,input().split()))
u=list(map(int,input().split()))
v=[list(map(int,input().split())) for i in range(s[2])]
a=10**6
d=0
e=0
for i in range(s[2]):
  d=v[i][0]-1
  e=v[i][0]-1
  b=t[d]+u[e]-v[i][2]
  a=min(a,b)
print(a)
Problem p02796 (python)

Fixed submission:
s=int(input())
t=[]
for i in range(s):
    u,l=map(int,input().split())
    t.append((u-l,u+l-1))
t.sort(key=lambda x: x[1])
d=-10**10
ans=0
for i in range(s):
  if d<t[i][0]:
    ans+=1
    d=t[i][1]
print(ans)

Buggy submission (verdict: Runtime Error):
s=int(input())
t=[]
for i in range(N):
    u,l = map(int,input().split())
    t.append((u-l,u+l-1))
t.sort(key=lambda x: x[1])
d=-10*10
ans=0
for i in range(s):
  a=t[i][0]-t[i][1]
  if d<a:
    ans+=1
    d=a+2*t[i][1]-1
print(ans)
Problem p02804 (python)

Fixed submission:
n,k=map(int,input().split())
A=list(map(int,input().split()))
mod=10**9+7
A.sort()
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod
N = 10**5
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル
for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )
ans,bns=0,0
for j in range(n-k+1):
  ans=(ans+(A[n-j-1]-A[j])*cmb(n-j-1,k-1,mod))%mod
print(ans%mod)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
A=list(map(int,input().split()))
mod=10**9+7
A.sort()
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod
N = 10**4
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル
for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )
ans,bns=0,0
for j in range(n-k+1):
  ans=(ans+(A[n-j-1]-A[j])*cmb(n-j-1,k-1,mod))%mod
print(ans%mod)
Problem p02814 (python)

Fixed submission:
import fractions
s=list(map(int,input().split()))
t=[int(i)//2 for i in input().split()]
ans = t[0]
for i in range(1,s[0]):
  ans=(ans*t[i])//fractions.gcd(ans,t[i])
  if ans>10**10:
    print(0)
    exit()
for j in t:
  if (ans//j)%2==0:
    print(0)
    exit()
if ans<=s[1]:
  print(int((s[1]//ans+1)//2))
else:
  print(0)

Buggy submission (verdict: Runtime Error):
import fractions
s=list(map(int,input().split()))
t=[int(i)//2 for i in input().split()]
ans = t[0]
a=0
for i in range(1,s[0]):
  ans=(ans*t[i])//fractions.gcd(ans,t[i])
for j in t:
  if (ans/j)%2==0:
    print(0)
    exit()
if ans<=s[1]:
  print(int((s[1]//ans+1)//2))
else:
  print(0)

Buggy submission (verdict: Runtime Error):
import fractions
s=list(map(int,input().split()))
t=[int(i)//2 for i in input().split()]
ans = t[0]
a=0
for i in range(1,s[0]):
  ans=(ans*t[i])//fractions.gcd(ans,t[i])
  if i==1:
    if (int(ans/t[0])%2==0) or (int(ans/t[i])%2==0):
      print(0)
      a=1
  else:
    if (int(ans/t[i])%2==0):
      print(0)
      a=1
if a==0:
  if ans<=s[1]:
    print(int((s[1]//ans+1)//2))
  else:
    print(0)
Problem p03059 (python)

Fixed submission:
s=list(map(int,input().split()))
a=s[2]%s[0]
c=s[2]-a
d=c/s[0]
b=d*s[1]
print(int(b))

Buggy submission (verdict: Runtime Error):
s = list(map(int, input().split()))
if(0<=s[0]=<20 and 0<=s[1]=<20 and 0<=s[2]=<20)
	z=round((s[2]+0.5)/s[0])
	w=s[1]*z
	print(w)
    
else:
  print("error")

Buggy submission (verdict: Runtime Error):
x=raw_input()
y=raw_input()
z=raw_input()
w=(int(z+0.5/x)*y)
print(w)
Problem p03060 (python)

Fixed submission:
s=list(map(int,input().split()))
t=list(map(int,input().split()))
u=list(map(int,input().split()))
vw=[]
for i in range(s[0]):
  if t[i]-u[i]>0:
    vw.append(t[i]-u[i])
print(sum(vw))

Buggy submission (verdict: Runtime Error):

i = list(map(int, input().split()))
s = list(map(int, input().split()))
t = list(map(int, input().split()))
z=0
for q in range(0,i[0]):
	if(s[q]-t[0]>0):
      z+s[q]
    else:
      
print(z)