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

Fixed submission:
N=int(input())
AB=[]
for i in range(N):
    AB.append(list(map(int,input().split())))
a=AB[0][1]
b=0
for i in range(1,N):
    if AB[i][1]<a:
        a=AB[i][1]
        b=i
print(a+AB[b][0])

Buggy submission (verdict: Runtime Error):
N=int(input())
AB=[]
for i in range(N):
    AB.append(list(map(int,input().split())))
a=AB[0][1]
for i in range(N-1):
    if AB[i+1][1]<AB[i][1]:
        a=AB[i+1][1]
        b=i+1
print(a+AB[b][0])

Buggy submission (verdict: Runtime Error):
N=int(input())
AB=[]
for i in range(N):
    AB.append(list(map(int,input().split())))
a=AB[0][1]
for i in range(N-1):
    if AB[i+1][1]<AB[i][1]:
        a=AB[i+1][1]
        b=i+1
print(a+AB[b][0])

Buggy submission (verdict: Runtime Error):
N=int(input())
AB=[]
for i in range(N):
    AB.append(list(map(int,input().split())))
A=[]
B=[]
for i in range(N):
    A.append(AB[i][0])
    B.append(AB[i][1])
for i in range(N):
    if B[i]==max(B):
        bmax=i
    elif B[i]==min(B):
        bmin=i
print(A[bmin]+B[bmin])

Buggy submission (verdict: Runtime Error):
N=int(input())
AB=[]
for i in range(N):
    AB.append(list(map(int,input().split())))
A=[]
B=[]
for i in range(N):
    A.append(AB[i][0])
    B.append(AB[i][1])
for i in range(N):
    if B[i]==max(B):
        bmax=i
    elif B[i]==min(B):
        bmin=i
print(A[bmin]+B[bmin])
Problem p02761 (python)

Fixed submission:
N,M=map(int,input().split())
if M==0:
    if N==1:
        print(0)
    else:
        print(10**(N-1))
else:
    S=[]
    C=[]
    for i in range(M):
        s,c=map(int,input().split())
        S.append(s)
        C.append(c)
    if N==1:
        o=0
    else:
        o=10**(N-1)
    for i in range(o,10**N):
        flag=True
        I=str(i)
        for j in range(M):
            if N<S[j]:
                flag=False
            else:
                if I[S[j]-1]!=str(C[j]):
                    flag=False
        if flag==True:
            print(i)
            exit()
    print(-1)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
ans=10**(N-1)
if M==0:
    print(ans)
else:
    S=[]
    C=[]
    for i in range(M):
        s,c=map(int,input().split())
        S.append(s)
        C.append(c)
    for i in range(1000):
        flag=True
        I=str(i)
        for j in range(M):
            if N<S[j]:
                flag=False
            else:
                if I[S[j]-1]!=str(C[j]):
                    flag=False
        if flag==True:
            print(i)
            exit()
    print(-1)
Problem p02817 (python)

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

Buggy submission (verdict: Runtime Error):
t,s=map(input().split())
print(s+t)
Problem p02947 (python)

Fixed submission:
N=int(input())
S_list=[]
for i in range(N):
    s=input()
    ss=list(s)
    ss.sort()
    S_list.append(ss)
S_list.sort()
ans=0
cnt=0
for i in range(1,N):
    if S_list[i]==S_list[i-1]:
        cnt+=1
        ans+=cnt
    else:
        cnt=0
print(ans)

Buggy submission (verdict: Runtime Error):
import math

N=int(input())
S=[]
for i in range(N):
    s=input()
    ss=list(s)
    ss.sort()
    S.append(ss)
S.sort()
ans=0
cnt=0
for i in range(N-1):
    if S[i]==S[i+1]:
        cnt+=1
    else:
        ans+=math.factorial(cnt-1)
        cnt=0
print(ans)
Problem p02995 (python)

Fixed submission:
import fractions
A,B,C,D=map(int,input().split())
CD=(C*D)//(fractions.gcd(C,D))
A=A-1
num_B=B-B//C-B//D+B//CD
num_A=A-A//C-A//D+A//CD
print(int(num_B-num_A))

Buggy submission (verdict: Runtime Error):
import math
A,B,C,D=map(int,input().split())
CD=(C*D)//(math.gcd(C,D))
A=A-1
num_B=B-B//C-B//D+B//CD
num_A=A-A//C-A//D+A//CD
print(int(num_B-num_A))

Buggy submission (verdict: Runtime Error):
import math
A,B,C,D=map(int,input().split())
CD=(C*D)//(math.gcd(C,D))
A=A-1
num_B=B-B//C-B//D+B//CD
num_A=A-A//C-A//D+A//CD
print(int(num_B-num_A))
print(CD)
Problem p03000 (python)

Fixed submission:
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=0
cnt=1
for i in range(N):
    D=D+L[i]
    if D<=X:
        cnt+=1
print(cnt)

Buggy submission (verdict: Runtime Error):
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=0
cnt=0
i=0
while(D<=X):
    cnt+=1
    D=D+L[i]
    i+=1
print(cnt)
Problem p03129 (python)

Fixed submission:
n,k=map(int,input().split())
if n%2==0:
    if n/2>=k:
        print('YES')
    else:
        print('NO')
else:
    if (n//2)+1>=k:
        print('YES')
    else:
        print('NO')

Buggy submission (verdict: Runtime Error):
n,k=map(int,input(),split())
if n%2==0:
    if n/2>=k:
        print('YES')
    else:
        print('NO')
else:
    if (n//2)+1>=k:
        print('YES')
    else:
        print('NO')
Problem p03147 (python)

Fixed submission:
n=int(input())
h=list(map(int,input().split()))
h.append(0)
ans=0
for i in range(max(h)):
    cnt=0
    for j in range(n+1):
        if h[j]>=i+1:
            cnt+=1
        else:
            if cnt>=1:
                ans+=1
            cnt=0
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input()
h=list(map(int,input().split()))
ans=0
for i in range(max(h)):
      cnt=0
      for j in range(n):
            if h［j］>=i+1:
                  cnt+=1
            elif j==n-1:
                  ans+=cnt
            else:
                  ans+=cnt
                  cnt=0
print(ans)
Problem p03219 (python)

Fixed submission:
A,B = map(int,input().split())

print(int(A+B/2))

Buggy submission (verdict: Runtime Error):
4 54
Problem p03565 (python)

Fixed submission:
S=input()
T=input()
s=0
flag1=False
for i in range(len(S)-len(T)+1):
    flag2=True
    for j in range(len(T)):
        if S[i+j]!=T[j] and S[i+j]!='?':
            flag2=False
    if flag2==True:
        flag1=True
        s=i
if flag1==False:
    print('UNRESTORABLE')
else:
    for i in range(len(S)):
        if i>=s and i-s<len(T):
            print(T[i-s],end='')
        elif S[i]=='?':
            print('a',end='')
        else:
            print(S[i],end='')

Buggy submission (verdict: Runtime Error):
S=input()
T=input()
s=0
flag1=False
for i in range(len(S)-len(T)+1):
    flag2=True
    for j in range(len(T)):
        if S[i+j]!=T[j] and S[i+j]!='?':
            flag2=False
    if flag2==True:
        flag1=True
        s=i
if flag1==False:
    print('UNRESTORABLE')
else:
    for i in range(len(S)):
        if i>=s:
            print(T[i-s],end='')
        elif S[i]=='?':
            print('a',end='')
        else:
            print(S[i],end='')
Problem p03607 (python)

Fixed submission:
N=int(input())
A=set()
for _ in range(N):
    a=int(input())
    if a not in A:
        A.add(a)
    else:
        A.remove(a)
print(len(A))

Buggy submission (verdict: Runtime Error):
N=int(input())
A={}
for _ in range(N):
    a=int(input())
    if a not in A:
        A.append(a)
    else:
        A.remove(a)
print(len(A))
Problem p02630 (python)

Fixed submission:
from collections import Counter
N=int(input())
A=list(map(int,input().split()))
Q=int(input())
counter=Counter(A)
sum_res=sum(A)
for i in range(Q):
  b,c=map(int,input().split())
  sum_res-=counter[b]*b
  sum_res+=counter[b]*c
  counter[c]+=counter[b]
  counter[b]=0
  print(sum_res)

Buggy submission (verdict: Runtime Error):
form collections import Counter
N=int(input())
A=list(map(int,input().split()))
Q=int(input())
counter=Counter(A)
sum_res=sum(A)
for i in range(Q):
  b,c=map(int,input().split())
  sum_res-=counter[b]*b
  sum_res+=counter[b]*c
  counter[c]+=counter[b]
  counter[b]=0
  print(sum_res)
Problem p02696 (python)

Fixed submission:
import math
A,B,N=map(int,input().split())
s=math.floor((A*(B-1))/B)
t=math.floor((A*N)/B)
print(min(s,t))

Buggy submission (verdict: Runtime Error):
import math
A,B,N=map(int,input().split())
s=math.floor((A*(B-1))/B))
t=math.floor((A*N)/B))
print(max(s,t))

Buggy submission (verdict: Runtime Error):
A,B,N=map(int,input().split())
s=math.floor((A*(B-1))/B))
t=math.floor((A*N)/B))
print(max(s,t))
Problem p02713 (python)

Fixed submission:
import math
K=int(input())
ans=0
for a in range(1,K+1):
  for b in range(1,K+1):
    ans_=math.gcd(a,b)
    for c in range(1,K+1):
      ans+=math.gcd(ans_,c)
print(ans)

Buggy submission (verdict: Runtime Error):
import math 
from itertools import product
from functools import reduce
def gcd(*numbers):
  return reduce(math.gcd,numbers)
K=int(input())
A=[]
as=range(1,K+1)
bs=range(1,K+1)
cs=range(1,K+1)
for a,b,c in product(as,bs,cs):
  s=gcd(a,b,c)
  A.append(s)
print(sum(A))
  
    
      A.append(s)
print(sum(A))

Buggy submission (verdict: Runtime Error):
import math 
K=int(input())
A=[]
for i in range(K):
  for j in range(K):
    for k in range(K):
      s=gcd(i,j,k)
      A.append(s)
print(sum(A)
Problem p02714 (python)

Fixed submission:
N = int(input())
S = list(input())

R = 0
G = 0
B = 0

for i in range(N):
	if S[i] == 'R':
		R += 1
	elif S[i] == 'G':
		G += 1
	else:
		B += 1
ans = R * G * B
for i in range(N - 2):
	for j in range(i + 1, N - 1):
		k = j + (j - i)
		if k >= N:
			break
		if S[i] != S[j] and S[i] != S[k] and S[j] != S[k]:
			ans -= 1
print(ans)

Buggy submission (verdict: Runtime Error):
import collections
N=int(input())
S=list(input())
s=collections.Counter(S)
m=s["R"]*s["G"]*s["B"]
s=0
for i in range(1,N-1):
  for j in range(i,N):
    k=2*j-i
    if S[i]!=S[j] and S[i]!=S[k] and S[j]!=S[k]:
      s+=1
print(m-s)
Problem p02732 (python)

Fixed submission:
import collections 
N=int(input())
A=list(map(int,input().split()))
s=0
cnt=collections.Counter(A)
for key in cnt.keys():
  s+=(cnt[key]*(cnt[key]-1))//2
for i in range(N):
  tmp=s
  tmp-=cnt[A[i]]*(cnt[A[i]]-1)//2
  tmp+=(cnt[A[i]]-1)*(cnt[A[i]]-2)//2
  print(tmp)

Buggy submission (verdict: Runtime Error):
import collections 
N=int(input())
A=list(map(int,input().split()))
s=0
cnt=collections.Counter(A)
for key in cnt.keys():
  s+=(cnt[key]*(cnt[key]-1))//2
for i in range(N):
  tmp=s
  tmp-=cnt(A[i])*(cnt(A[i])-1)//2
  tmp+=(cnt(A[i])-1)*(cnt(A[i])-2)//2
  print(tmp)
Problem p02755 (python)

Fixed submission:
import math
A,B=map(int,input().split())
C=[]
for i in range(1,1010):
  if math.floor(i*0.08)==A and math.floor(i*0.1)==B:
    C.append(i)
if len(C)==0:
  print("-1")
else:
  print(min(C))

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
j=A*12.5
k=(A+1)*12.5
l=B*12.5
m=(B+1)*12.5
N=[]
O=[]
for i in range(j,k+1):
  N.append(i)
for h in range(l,m+1):
  O.append(h)
N_set=set(N)
O_set=set(O)
matched_list=list(N_set&O_set)
print(min(matched_list))
Problem p02791 (python)

Fixed submission:
N=int(input())
P=list(map(int,input().split()))
s=1
m=P[0]
for i in range(1,N):
  if P[i]<=m:
    m=P[i]
    s+=1
print(s)

Buggy submission (verdict: Runtime Error):
N=int(input())
P=list(map(int,input().split()))
s=1
for i in range(1,N):
  if P[i]==min(P[0:i+1])
    s+=1
print(s)

Buggy submission (verdict: Runtime Error):
N=int(input())
P=list(map(int,input().split()))
s=0
for i in range(N):
  if P[i]<=min(P[0:i]):
    s+=1
print(s)
Problem p02813 (python)

Fixed submission:
import itertools
N=int(input())
P=tuple(map(int,input().split()))
Q=tuple(map(int,input().split()))
permutations=list(itertools.permutations(range(1,N+1)))
p=permutations.index(P)
q=permutations.index(Q)
ans=abs(p-q)
print(ans)

Buggy submission (verdict: Runtime Error):
import itertools
N=int(input())
P=list(map(int,input().split()))
Q=list(map(int,input().split()))
permutations=list(itertools.permutations(range(1,N+1)))
p=permutations.index(P)
q=permutations.index(Q)
ans=abs(p-q)
print(ans)
Problem p02830 (python)

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

Buggy submission (verdict: Runtime Error):
N=int(input())
S,T=map(str,input().split())
U=str()
for i in range(N):
  U.append(S[i])
  U.append(T[i])
print(U)

Buggy submission (verdict: Runtime Error):
N=int(input())
S,T=map(str,input().split())
a=()
for i in range(N):
  a+=S[i]
  a+=T[i]
print(a)

Buggy submission (verdict: Runtime Error):
N=int(input())
S,T=map(str,input().split())
U=[]
for i in range(len(T)):
  U.append(S[i],T[i])
print(U)
Problem p02885 (python)

Fixed submission:
A,B=map(int,input().split())
if A>=(B*2):
   print(A-(B*2))
else:
   print(0)

Buggy submission (verdict: Runtime Error):
A,B=map(int,input()split())
if A>=B*2:
  print(A-B*2)
else:
  print(0)
Problem p02886 (python)

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

Buggy submission (verdict: Runtime Error):
N=int(input())
d=map(int,input().split())
s=list(d)
l=[]
for i in range(N-1):
  for j in range(i+1,N):
  l.append(i*j)
print(sum(l))

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

Buggy submission (verdict: Runtime Error):
N=int(input())
d=list(map(int,input().split() for i in range(N)))
a=[]
for i in range(d):
  for j in range(d):
  a.append(set(i*j))
print(sum(a))
Problem p02887 (python)

Fixed submission:
N=int(input())
S=input()
c=1
for i in range(1,N):
  if S[i-1]!=S[i]:
    c+=1
print(c)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
c=1
for i in range(N):
  if S[i]!=S[i+1]:
    c+=1
print(c)
Problem p02888 (python)

Fixed submission:
import bisect
N=int(input())
L=list(map(int,input().split()))
i=0
L=sorted(L)
for a in range(N):
  for b in range(a+1,N):
    c=bisect.bisect_left(L,L[a]+L[b])
    if c>b:
      i+=c-b-1
    else:
      i=i
print(i)

Buggy submission (verdict: Runtime Error):
import bisect
N=int(input())
L=list(map(int,input().split()))
L=sorted(L)
ans=0
for a in range(N):
  for b in range(a+1,N)):
    c=bisect.bisect_left(L,L[a]+L[b])
    if c>b:
      ans+=c-b-1
    else:
      ans=ans
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
L=list(map(int,input().split()))
i=0
L=sorted(L)
for a in range(N):
  for b in range(a+1,N):
    c=bisect.bisect_left(L,L[a]+L[b])
    if c>b:
      i+=c-b
    else:
      i=i
print(i)
Problem p02910 (python)

Fixed submission:
S=input()
if all(c  in 'RUD' for c in S[::2]) and all(c in 'LUD' for c in S[1::2]):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S=list(input())
E=[]
O=[]
for i in range(len(S)):
  if i%2==0:
    E.append(S[i])
  else:
    O.append(S[i])
if R in E or L in O:
  print("No")
else:
  print("Yes")
S=list(input())
E=[]
O=[]
for i in range(len(S)):
  if i%2==0:
    E.append(S[i])
  else:
    O.append(S[i])
if "R" in E or "L" in O:
  print("No")
else:
  print("Yes")
提出情報

Buggy submission (verdict: Runtime Error):
S=list(input())
E=[]
O=[]
for i in range(len(S)):
  if i%2==0:
    E.append(S[i])
  else:
    O.append(S[i])
if R in E or L in O:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
S=input()
O=[]
E=[]
for i in len(S):
  if i%2==0:
    E.append(S[i])
  else:
    O.append(S[i])
if L in O or R in E:
  print("No")
else:
  print("Yes")
Problem p02911 (python)

Fixed submission:
N,K,Q=map(int,input().split())
point=[K]*N
for i in range(Q):
  A=int(input())
  A=A-1
  point[A]+=1
for j in range(N):
  if point[j]>Q:
    print("Yes")
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
N,K,Q=map(int,input().split())
point=[K]*n
for i in range(Q):
  A=int(input())
  A=A-1
  point[A]+=1
for j in range(N):
  if point[j]>Q:
    print("Yes")
  else:
    print("No")
Problem p02917 (python)

Fixed submission:
N=int(input())
B=list(map(int,input().split()))
A=[0]*N
A[0]=B[0]
A[N-1]=B[N-2]
for i in range(1,N-1):
  A[i]=min(B[i-1],B[i])
print(sum(A))

Buggy submission (verdict: Runtime Error):
N=int(input().split())
B=list(map(int,input().split()))
A=[0]*N
A[0]=B[0]
A{N-1]=B[N-2]
for i in range(1,N-2):
  A[i]=min(B[i-1],B[i])
print(sum(A))

Buggy submission (verdict: Runtime Error):
N=int(input().split())
B=list(map(int,input().split()))
A=[0}*N
A[0]=B[0}
A{N-1]=B[N-2]
for i in range(1,N-2):
  A[i]=min(B[i-1],B[i])
print(sum(A))

Buggy submission (verdict: Runtime Error):
N=int(input())
B=list(map(int,input().split()))
A=[0]*N
for i in range(N-1):
  if B[i]<B[i+1]:
    A[i]+=B[i],A[i+1]+=B[i],A[i+2]+=B[i+1]
  elif B[i]>B[i+1]:
    A[i]+=B[i],A[i+1]+=B[i+1],A[i+2]+=B[i+1]
  else:
    A[i]+=B[i],A[i+1]+=B[i],A[i+2]+=B[i]
print(sum(A))
Problem p02923 (python)

Fixed submission:
N=int(input())
H=list(map(int,input().split()))
ans=0
cnt=0
for i in range(N-1):
  if H[i]>=H[i+1]:
    cnt+=1
  else:
    ans=max(cnt,ans)
    cnt=0
ans=max(ans,cnt)
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
H=list(map(int,input().split()))
ans=0
cnt=o
for i in range(N-1):
  if H[i]>=H[i+1]:
    cnt+=1
  else:
    ans=max(cnt,ans)
    cnt=0
ans=max(ans,cnt)
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
H=list(map(int,input().split()))
ans=0
cnt=o
for i in range(N-1):
  if H[i]>=H[i+1]:
    cnt+=1
  else:
    ans=max(cnt,ans)
    cnt=0
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
H=list(map(int,input().split()))
i=0
s=o
t=[]
while H[i]>=H[i+1]:
  s+=1
  i+=1
  if H[i]<H[i+1]:
    t.append(s)
    break
print(max(t))

Buggy submission (verdict: Runtime Error):
N=int(input())
H=list(map(int,input().split()))
s=[]
t=0
for i in range(N):
  while H[i]>H[i+1]:
    t+=1
  s.append(t)
print(max(s))
Problem p02934 (python)

Fixed submission:
N=int(input())
A=map(int,input().split())
s=sum(1/i for i in A)
t=1/s
print(t)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=map(int,input().split())
s=sum(1/i) for i in A
t=1/s
print(t)
Problem p02946 (python)

Fixed submission:
K,X=map(int,input().split())
for i in range(X-K+1,X+K):
  print(i)

Buggy submission (verdict: Runtime Error):
,X=map(int,input().split())
a=[]
for i in range(0,K):
  a.append(X-i)
for j in range(1,K):
  a.append(X+j)
s=a.sort()
print(s)

Buggy submission (verdict: Runtime Error):
,X=map(int,input().split())
a=[]
for i in range(0,K):
  a.append(X-i)
for i in range(1,K):
  a.append(X+i)
s=a.sort()
print(s)
Problem p02952 (python)

Fixed submission:
s=0
N=int(input())
for i in range(1,N+1):
  if (len(str(i)))%2!=0:
    s+=1
print(s)

Buggy submission (verdict: Runtime Error):
def main:
  s=0
  N=int(input())
  for i in range(1,N+1):
    if (len(str(i)))%2!=0:
      s+=1
  print(s)
main

Buggy submission (verdict: Runtime Error):
def main:
  s=0
  N=int(input())
  for i in range(1,N+1):
    if (len(str(i)))%2!=0:
      s+=1
  print(s)
main()

Buggy submission (verdict: Runtime Error):
def main:
  s=0
  N=int(input())
  for i in range(1,N+1):
    if (len(str(i)))%2!=0:
      s+=1
  print(s)
Problem p02957 (python)

Fixed submission:
A,B=map(int,input().split())
if (A+B)%2==0:
  print((A+B)//2)
else:
  print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
if A-K==-(B-K):
  print(K)
else:
  print("IMPOSSIBLE")
Problem p02971 (python)

Fixed submission:
N=int(input())
list=[]
for i in range(N):
  A=int(input())
  list.append(A)
l=sorted(list,reverse=True)
A_1=l[0]
A_2=l[1]
for j in range(N):
  if list[j]!=A_1:
    print(A_1)
  else:
    print(A_2)

Buggy submission (verdict: Runtime Error):
N=int(input())
list=[]
for i in range(N):
  A=int(input())
  list.append(A)
l=sorted(list,reverse=True)
k=set(list)
A_1=k[0]
A_2=k[1]
for j in range(N):
  if list[j]!=A_1:
    print(A_1)
  else:
    print(list[1])

Buggy submission (verdict: Runtime Error):
N=int(input())
list=[]
for i in range(N):
  A=int(input())
  list.append(A)
for j in range(N):
  del list[j]
  print(max(list))

Buggy submission (verdict: Runtime Error):
N=int(input())
for i in range(N):
  A=int(input())
  list.append(A)
for j in range(N):
  del list[j]
  print(max(list))

Buggy submission (verdict: Runtime Error):
N=int(input()
for i in range(N):
  A=int(input())
  list.append(A)
for j in range(N):
  del list[j]
  print(max(list))

Buggy submission (verdict: Runtime Error):
N=int(input())
list=[]
for i in range(N):
  A=int(input())
  list.append(A)
for j in range(N):
  del list[j]
  print(max(list))

Buggy submission (verdict: Runtime Error):
N=int(input())
list=[]
for i in range(N):
  A=int(input())
  list.append(A)
for j in range(N):
  list=list.remove(list[j])
  print(max(list))
Problem p02983 (python)

Fixed submission:
L,R=map(int,input().split())
if (R-L)>=2018:
  print(0)
else:
  ans=2019
  for i in range(L,R):
    for j in range(i+1,R+1):
      ans=min(ans,(i*j)%2019)
  print(ans)

Buggy submission (verdict: Runtime Error):
L,R=map(int,input().split())
list=[]
if (R-L)>=2018:
  print(0)
else:
  ans=2019
  for i in range(L,R):
    for j in range(i+1,R+1):
      ans=min(ans,(i*j)%2019)
print(ans)

Buggy submission (verdict: Runtime Error):
L,R=map(int,input().split())
list=[]
if (R-L)>=2018 or L==0:
  print(0)
else:
  for i in range(L,R):
    for j in range(i+1,R+1):
      s=i*j
      m=s%2019
      list.append(m)
print(min(list))

Buggy submission (verdict: Runtime Error):
L,R=map(int,input().split())
list=[]
if (R-L)>=2018 or L==0:
  print(0)
else:
  for i in range(L,R):
    for j in range(i+1,R+1):
      s=i*j
      m=s%2019
      list.append(m)
print(min(list))

Buggy submission (verdict: Runtime Error):
L,R=map(int,input().split())
list=[]
if (R-L)>=2018:
  print(0)
else:
  for i in range(L,R):
    for j in range(i+1,R+1):
      s=i*j
      m=s%2019
      list.append(m)
print(min(list))

Buggy submission (verdict: Runtime Error):
L,R=map(int,input().split())
if (R-L)>=2018:
  print(0)
else:
  ans=2019
  for i in range(L,R):
    for j in range(i+1,R+1):
      ans=min(ans,I*j//2019)
print(ans)

Buggy submission (verdict: Runtime Error):
L,R=map(int,input().split())
if (L-R)>=2018:
  print(0)
else:
  ans=2019
  for i in range(L,R):
    for j in range(i+1,R+1):
      ans=min(ans,I*j//2019)
print(ans)
Problem p02993 (python)

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

Buggy submission (verdict: Runtime Error):
S=input()
if S[0]==S[1] or S[1]==S[2] or S[2]==S[3}:
  print("Bad")
else:
  print("Good")

Buggy submission (verdict: Runtime Error):
S=int(input())
if S[0]==S[1] or S[1]==S[2} or S[2]==S[3]:
  print("Bad")
else:
  print("Good")
Problem p02994 (python)

Fixed submission:
N,L=map(int,input().split())
s=[]
for i in range(1,N+1):
  s.append(L+i-1)
s.sort(key=lambda x: abs(x))
del s[0]
print(sum(s))

Buggy submission (verdict: Runtime Error):
N,L=map(int,input().split())
s=[]
for i in range(1,N+1):
  s.append(L+i-1)
t=s.remove(min(abs(s)))
print(sum(t))

Buggy submission (verdict: Runtime Error):
N,L=map(int,input().split())
s=[]
for i in range(1,N+1):
  s.append(L+i-1)
s.remove(min(abs(s)))
print(sum(s))

Buggy submission (verdict: Runtime Error):
N,L=map(int,input().split())
＃リンゴの味のリスト
s=[]
for i in range(1,N+1):
  s.append(L+i-1)
＃リンゴの味の絶対値のリスト
s.remove(min(abs(s[i-1])))
print(sum(s))

Buggy submission (verdict: Runtime Error):
N,L=map(int,input().split())
s=[]
for i in range(1,N+1):
  s.append(L+i-1)
t=min(abs(s[i-1]))
s.remove(t)
print(sum(s))

Buggy submission (verdict: Runtime Error):
N,L=map(int,input().split())
s=[]
for i in range(1,N+1):
  s.append(L+i-1)
s.remove(min(abs(j for j in s)))
print(sum(s))
Problem p02995 (python)

Fixed submission:
A,B,C,D=map(int,input().split())
def gcd(a,b):
  while b:
    a,b=b,a%b
  return a
def lcm(a,b):
  return (a*b)//gcd(a,b)
s=(A-1)//C
t=(A-1)//D
u=(A-1)//lcm(C,D)
v=s+t-u
w=A-1-v
S=B//C
T=B//D
U=B//lcm(C,D)
V=S+T-U
W=B-V
print(W-w)

Buggy submission (verdict: Runtime Error):
import fractions
A,B,C,D=map(int,input().split())
#B以下のものの数からA-1以下のものの数を引く
e=fractions.gcd(C,D)
a_c=(A-1)//C #A-1以下のCの倍数の個数
b_c=B//C  #B以下のCの倍数の個数
a_d=(A-1)//D
b_d=B//D
a_cd=A//e
b_cd=B//e
s=A-1-(a_c+a_d-a_cd)　＃A-1以下の数字のうちCでもDでも割り切れないものの個数
t=B-(b_c+b_d-b_cd)　#B以下の数字の
u=t-s
print(u)

Buggy submission (verdict: Runtime Error):
A,B,C,D=map(int,input().split())
s=0
for i in range(A,B+1):
  if i%C!=0 and i$D!=0:
    s+=1
print(s)