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

Fixed submission:

MOD = 1000000007

def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

def lcm(a, b):
    return a//gcd(a,b)*b

n = int(input())
a = list(map(int,input().split()))
all_lcm = 1
for i in range(n):
    all_lcm = lcm(all_lcm, a[i])
ans = 0
for i in range(n):
    ans += all_lcm//a[i]
print(ans%MOD)

Buggy submission (verdict: Runtime Error):

global MOD = 1000000007

def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

def lcm(a, b):
    return a*b//gcd(a,b)

def main():
    n = int(input())
    a = list(map(int,input().split()))
    all_lcm = a[0]
    for i in range(n):
        all_lcm = lcm(all_lcm, a[i])
    ans = 0
    for i in range(n):
        ans += all_lcm//a[i]
        ans %= MOD
    print(ans)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):

MOD = 1000000007

def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

def lcm(a, b):
    return a*b/gcd(a,b)

def main():
    n = int(input())
    a = list(map(int,input().split()))
    all_lcm = a[0]
    for i in range(n):
        all_lcm = lcm(all_lcm, a[i])
    ans = 0
    for i in range(n):
        ans += all_lcm/a[i]
        ans %= MOD
    print(int(ans))

main()
Problem p02915 (python)

Fixed submission:
n = int(input())
password = n**3
print(password)

Buggy submission (verdict: Runtime Error):
def main():
    n = int(input())
    a = input().split()
    b = input().split()
    c = input().split()
    score = 0
    for i in range(n):
        num = int(a[i])
        next = int(a[i-1])
        score += int(b[num-1])
        if next - num == 1:
            score += int(c[num-1])
    print(score)

if __name__ == "__main__":
    main()
Problem p02916 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
 
ans=0
pre=-1
 
for i in a:
  ans += b[i-1]
  if(i==pre+1):
    ans += c[i-2]
  pre=i
  
print(ans)

Buggy submission (verdict: Runtime Error):
def main():
    n = int(input())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    c = list(map(int, input().split()))    
    score = 0
    pre = -1
    for i in a:
        score += b[i]
        if(i==pre+1):
            score += c[i-2]
            pre=i
    print(score)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    n = int(input())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    c = list(map(int, input().split()))    
    score = 0
    pre = -1
    for i in a:
        score += b[i]
        if(i==pre+1):
            score += c[i-2]
            pre =i
    print(score)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    n = int(input())
    a = int(input().split())
    b = int(input().split())
    c = int(input().split())
    score = 0
    for i in range(n):
        score += b[a[i]]
        if a[i+1] - a[i] == 1:
            score += c[a[i]-1]
    print(score)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    n = int(input())
    a = input().split()
    b = input().split()
    c = input().split()
    score = 0
    for i in range(n):
        score += a[i]
        if a[i+1] - a[i] == 1:
            score += b[i]
    print(score)

if __name__ == "__main__":
    main()
Problem p02627 (python)

Fixed submission:
s = input()
if s == s.lower():
    print('a')
else:
    print('A')

Buggy submission (verdict: Runtime Error):
s = int(input())
if s == s.lower():
    print('a')
else:
    print('A')
Problem p02659 (python)

Fixed submission:
A, B = input().split()
A = int(A)
B = int(B.replace('.', ''))
ans = A * B // 100
print(ans)

Buggy submission (verdict: Runtime Error):
A, B = input().split()
A = int(A)
B = float(B)
ans = int(A * B)
print(ans)
A, B = input().split()
A = int(A)
B = float(B)
ans = int(A * B)
print(ans)
Problem p02959 (python)

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

s1 = sum(a)
for i in range(n + 1):
    if i == 0:
        if a[i] < b[i]:
            b[i] -= a[i]
            a[i] = 0
        else:
            a[i] -= b[i]
            b[i] = 0
    elif i == n:
        if a[i] < b[i - 1]:
            a[i] = 0
        else:
            a[i] -= b[i - 1]
            b[i - 1] = 0
    else:
        if a[i] < b[i - 1]:
            a[i] = 0
        else:
            a[i] -= b[i - 1]
        if a[i] < b[i]:
            b[i] -= a[i]
            a[i] = 0
        else:
            a[i] -= b[i]
            b[i] = 0
print(s1 - sum(a))

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

s1 = sum(a)
for i in range(n + 1):
    if i == 0:
        if a[i] < b[i]:
            b[i] -= a[i]
            a[i] = 0
        else:
            a[i] -= b[i]
            b[i] = 0
    elif i == n:
        if a[i] < b[i - 1]:
            a[i] = 0
        else:
            a[i] -= b[i - 1]
            b[i] = 0
    else:
        if a[i] < b[i - 1]:
            a[i] = 0
        else:
            a[i] -= b[i - 1]
        if a[i] < b[i]:
            b[i] -= a[i]
            a[i] = 0
        else:
            a[i] -= b[i]
            b[i] = 0
print(s1 - sum(a))
Problem p03137 (python)

Fixed submission:
import sys
# from collections import deque
# import bisect
# import math
# import itertools
# from queue import deque
# from math import gcd

INF = float('inf')
mod = 10**9+7
eps = 10**-7


def inp(): return int(sys.stdin.readline())


def inp_list(): return list(map(int, sys.stdin.readline().split()))


def lcm(x, y): return (x * y) // gcd(x, y)


N, M = inp_list()
X = inp_list()
X.sort()
# print(X)

if N >= M:
    print(0)
    exit()

d = [X[i + 1] - X[i] for i in range(M - 1)]
# for i in range(M - 1): d.append(X[i + 1] - X[i])
# print(d)
d.sort()
# ans = sum(d[: - (N - 1)])
ans = 0
for i in range(M - 1 -  (N - 1)):
    ans += d[i]
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
from collections import deque
import bisect
import math
import itertools
from queue import deque
from math import gcd

INF = float('inf')
mod = 10**9+7
eps = 10**-7


def inp(): return int(sys.stdin.readline())


def inp_list(): return list(map(int, sys.stdin.readline().split()))


def lcm(x, y): return (x * y) // gcd(x, y)


N, M = inp_list()
X = inp_list()
X.sort()
# print(X)

d = []
for i in range(M - 1): d.append(X[i + 1] - X[i])
# print(d)
d.sort()
ans = sum(d[: - (N - 1)])
print(ans)
Problem p02859 (python)

Fixed submission:
print(int(input())**2)

Buggy submission (verdict: Runtime Error):
print(input()**2)

Buggy submission (verdict: Runtime Error):
r=Input()
print(r^2)
Problem p02860 (python)

Fixed submission:
x=int(input())
string=input()
if x%2==1:
  print("No")
else:
  if string[:x//2]==string[x//2:]:
  	print("Yes")
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
x=int(input())
string=input()
if x%2=1:
  print("No")
else:
  if string[:x/2]==string[x/2:]
  	print("Yes")
  else:
    print("No")
Problem p03835 (python)

Fixed submission:
def f(K, S):
    num=0
    for a in range(K+1):
      if S-a>=0 and S-a<=2*K:
        if S-a<=K:
          num+=S-a+1
        else:
          num+=(K-((S-a)-K))+1
    return num

  
K,S=(int(x) for x in input().split())
print(f(K,S))

Buggy submission (verdict: Runtime Error):
def f(K, S):
    num=0
    for a in range(K+1):
      if S-a>=0 and S-a<=2*K:
        if S-a<=K:
          num+=S-a+1
        else:
          num+=min((S-a)-K,K)+1
    return num

  
(K,S)=input()
print(f(K,S))
Problem p02847 (python)

Fixed submission:
SUN=7
MON=6
TUE=5
WED=4
THU=3
FRI=2
SAT=1
x=input()	
print(x)

Buggy submission (verdict: Runtime Error):
SAN=7
MON=6
TUE=5
WED=4
THU=3
FRI=2
SAT=1
x=input()	
print(x)

Buggy submission (verdict: Runtime Error):
SAN=7
MON=6
TUE=5
WED=4
THU=3
FRI=2
SAT=1
x=input()	
print(x)
Problem p02659 (python)

Fixed submission:
from decimal import Decimal as dec
a, b=map(dec, input().split())
print(int(a*b))

Buggy submission (verdict: Runtime Error):
line=input().split()
a,b = int([line[0]]), float(line[1])

print(int(a*b))

Buggy submission (verdict: Runtime Error):
a=int(input())
b=float(input())

print(int(a*b))
Problem p02682 (python)

Fixed submission:
a, b, c, k = map(int, input().split())
    
if(k-a<=0):
    print(k)
elif(k-a-b<=0):
    print(1*a - 0*(k-a))
else :
    print(1*a+0*b-1*(k-a-b))

Buggy submission (verdict: Runtime Error):
a, b, c, k = map(int, input().split())
    
if(k-a-b<=0):
    print(max(1*a+0*(k-a)))
else :
    print(max(1*a+0*b-1*(k-a-b)))
Problem p02693 (python)

Fixed submission:
k =int(input())
a, b = map(int, input().split())
 
for i in range(a, b+1):
    if (i % k == 0):
        print("OK")
        break
else:
    print("NG")

Buggy submission (verdict: Runtime Error):

k =int(input())
a, b = map(int, input().split())
 
for i in range(a, b):
    j = i % k
    if (j == 0):
        break
   
if(j == 0):
    print("OK")
else:
    print("NG")

Buggy submission (verdict: Runtime Error):
k =int(input())
a, b = map(int, input().split())
 
for i in range(a, b):
    if (i % k == 0):
        break
    j = i % k 
if(j == 0):
    print("OK")
else:
    print("NG")

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

for i in range(a, b):
    if(i % k == 0):
        break
    
if(i % k == 0):
    print('OK')
else:
    print('NG')

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

for i in range(a, b):
    if(i % k == 0):
        break
    
if(i % k == 0):
    print("OK")
else:
    print("NG")

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

for i in range(a, b):
    if(i%k==0):
        break

if(break):   
    print("OK")
else:
    print("NG")

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

for i in range(a, b):
    if (i % k == 0):
        break
    
if(i%k==0):
    print("OK")
else:
    print("NG")
Problem p02557 (python)

Fixed submission:
N=int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
B.sort(reverse=True)
Arev=sorted(A, reverse=True)
Brev=sorted(B)
atai=0
s=0
for i in range(len(A)):
    if A[i]==B[i]:
        atai=A[i]
        s+=1
C=[]
for i in range(len(A)):
    C.append(A[i]-B[i])
if s>0:
    hajime=C.index(0)
if s==0:
    print("Yes")
    print(*B)
else:
    Acount=A.count(atai)
    Bcount=B.count(atai)
    if N-Acount<Bcount:
        print("No")
    else:
        afirst=A.index(atai)
        alast=N-1-Arev.index(atai)
        bfirst=B.index(atai)
        blast=N-1-Brev.index(atai)
        t=min(afirst,bfirst)
        if t>=s:
            for i in range(0,s):
                B[hajime+i]=B[i]
                B[i]=atai
        else:
            for i in range(0,t):
                B[hajime+i]=B[i]
                B[i]=atai
            ss=s-t
            for i in range(0,ss):
                B[hajime+t+i]=B[-i-1]
                B[-i-1]=atai
        print("Yes")
        print(*B)

Buggy submission (verdict: Runtime Error):
N=int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
B.sort(reverse=True)
Arev=sorted(A, reverse=True)
Brev=sorted(B)
atai=0
s=0
for i in range(len(A)):
    if A[i]==B[i]:
        atai=A[i]
        s+=1
C=[]
for i in range(len(A)):
    C.append(A[i]-B[i])
if 0 in C =="True":
    hajime=C.index(0)
if s==0:
    print("Yes")
    print(*B)
else:
    Acount=A.count(atai)
    Bcount=B.count(atai)
    if N-Acount<Bcount:
        print("No")
    else:
        afirst=A.index(atai)
        alast=N-1-Arev.index(atai)
        bfirst=B.index(atai)
        blast=N-1-Brev.index(atai)
        t=min(afirst,bfirst)
        if t>=s:
            for i in range(0,s):
                B[hajime+i]=B[i]
                B[i]=atai
        else:
            for i in range(0,t):
                B[hajime+i]=B[i]
                B[i]=atai
            ss=s-t
            for i in range(0,ss):
                B[hajime+t+i]=B[-i-1]
                B[-i-1]=atai
        print("Yes")
        print(*B)

Buggy submission (verdict: Runtime Error):
N=int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
B.sort(reverse=True)
Arev=sorted(A, reverse=True)
Brev=sorted(B)
atai=0
s=0
for i in range(len(A)):
    if A[i]==B[i]:
        atai=A[i]
        s+=1
C=[]
for i in range(len(A)):
    C.append(A[i]-B[i])
hajime=C.index(0)
if s==0:
    print("Yes")
    print(*B)
else:
    Acount=A.count(atai)
    Bcount=B.count(atai)
    if N-Acount<Bcount:
        print("No")
    else:
        afirst=A.index(atai)
        alast=N-1-Arev.index(atai)
        bfirst=B.index(atai)
        blast=N-1-Brev.index(atai)
        t=min(afirst,bfirst)
        if t>=s:
            for i in range(0,s):
                B[hajime+i]=B[i]
                B[i]=atai
        else:
            for i in range(0,t):
                B[hajime+i]=B[i]
                B[i]=atai
            ss=s-t
            for i in range(0,ss):
                B[hajime+t+i]=B[-i-1]
                B[-i-1]=atai
        print("Yes")
        print(*B)
Problem p02624 (python)

Fixed submission:
import math
n=int(input())
s=0
for i in range(1,n+1):
    s+=i*((math.floor(n/i)*math.floor(n/i+1))/2)
print (int(s))

Buggy submission (verdict: Runtime Error):
def make_divisors(n):
    if n>1:
        divisors = []
        for i in range(1, int(n**0.5)+1):
            if n % i == 0:
                divisors.append(i)
                if i != n // i:
                    divisors.append(n//i)
        divisors.sort()
        return n*len(divisors)+make_divisors(n-1)
    elif n==1:
        return 1
n=int(input())
make_divisors(n)

Buggy submission (verdict: Runtime Error):
def make_divisors(n):
    if n>1:
        divisors = []
        for i in range(1, int(n**0.5)+1):
            if n % i == 0:
                divisors.append(i)
                if i != n // i:
                    divisors.append(n//i)
        divisors.sort()
        return n*len(divisors)+make_divisors(n-1)
    elif n=1:
        return 1
n=int(input())
make_divisors(n)
Problem p02793 (python)

Fixed submission:
n=int(input())
A=list(map(int,input().split()))
mod=10**9+7
def lcm(X,Y):
    x=X
    y=Y
    if y>x:
        x,y=y,x
    while x%y!=0:
        x,y=y,x%y
    return X*Y//y

cnt=0
ans=0
LCM=1
for i in range(n):
    Q=lcm(LCM,A[i])
    cnt*=Q//LCM
    LCM=Q
    cnt+=Q//A[i]
print(cnt%mod)

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
N=int(input())
huga = list(map(int, input().split()))
X=lcm_list(huga)
sum1=0
for i in range (N):
    sum1+=(X/huga[i])%(10**9+7)
print(int(sum1))
Problem p02879 (python)

Fixed submission:
A,B = map(int,input().split())
if 1 <= A and A <=9 and 1 <= B and B <=9 :
    print(A*B)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
if 1 <= A and A <=9 and 1 <= B and B <=9 :
    print(A*B)
else:
    print(-1)
Problem p02880 (python)

Fixed submission:
N = int(input())
a = 0
for i in range(1,10):
    if N % i == 0:
        if N/i <= 9:
            a = 1
        else:
            continue
    else:
        continue
if a == 1:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
A,B = map(int,input().split())
if 1 <= A and A <=9 and 1 <= B and B <=9 :
    print("Yes")
else:
    print("No")
Problem p02627 (python)

Fixed submission:
a=input()
if a.islower():
    print('a')
else:
    print('A')

Buggy submission (verdict: Runtime Error):
N=int(input())
List='a b c d e f g h i j k l m n o p q r s t u v d x y z'.split()
print(List)

Ans=''

while N>=1:
    Amari=N%26
    
    if Amari==0:
        Ans='z'+Ans
    else:
        Ans=List[Amari-1]+Ans
        
    N=(N-1)//26
    
print(Ans)
Problem p02699 (python)

Fixed submission:
a,b = map(int,input().split())
if b>=a:
    print("unsafe")
else:
    print("safe")

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
if b>=a:
    print("unsafe")
else:
    print("safe")
Problem p02723 (python)

Fixed submission:
s_in = input()
if s_in[2]==s_in[3] and s_in[4]==s_in[5]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
s_in = S
if s_in[2]==s_in[3] and s_in[4]==s_in[5]:
    print('yes')
else:
    print('no')
Problem p02629 (python)

Fixed submission:
N = int(input())
l = []
while N:
    N -= 1
    l.append(chr(97+(N % 26)))
    N //= 26

print("".join(l[::-1]))

Buggy submission (verdict: Runtime Error):
n = int(input())
l = []
while n:
    N -= 1
    l.append(chr(97+(n % 26)))
    n //= 26

print("".join(l[::-1]))
Problem p02570 (python)

Fixed submission:
D,T,S = map(int, input().split())

A =  D/S

if (A  > T):
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
INF = 10 ** 9 + 7
N = int(input())
A = list(map(int, input().split()))
S = [sum(A)]#A[0]~A[N-1]の総和を求める

ans = 0
for i in range(N):
    key = S[-1]#Sの一番後ろの配列をとる(要素は一つしかない)
    S.append(key - A[i])#総和からA[i]を引いてあげたものをS配列に加えてあげるS配列はみぎに行くにつれて値が小さくなる
    #print(S)
    ans += (A[i] * S[-1])#Ansは実際の総和計算に当たるもの

print(ans % INF)
Problem p02689 (python)

Fixed submission:
N, M = map(int, input().split())
H = list(map(int, input().split()))
preH =[]
for i in range(M):
    preH.append(list(map(int, input().split())))
ans = [True]*N

for i in range(M):
    A,B = preH[i]


    if(H[A-1]<=H[B-1]):
        ans[A-1] = False
    if(H[B-1]<=H[A-1]):
        ans[B-1] = False

print(ans.count(True))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
H = list(map(int, input().split()))
preH = [0 for i in range(N)]

for i in range(M):
    preH.append(list(map(int, input().split())))
ans = [True]*N

for i in range(M):
    A,B = preH[i] #一行ずつ処理

    if(H[A-1]>=H[B-1]):
        ans[A-1] = False
    if(H[B-1]>=H[A-1]):
        ans[B-1] = False

print(ans.count(True))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
H = list(map(int, input().split()))
preH = [0 for i in range(N)]

for i in range(M):
    preH.append(list(map(int, input().split())))
ans = [True]*n

for i in range(M):
    A,B = preH[i] #一行ずつ処理

    if(H[A-1]>=H[B-1]):
        ans[A-1] = False
    if(H[B-1]>=H[A-1]):
        ans[B-1] = False

print(ans.count(True))
Problem p02693 (python)

Fixed submission:
K = int(input())
A,B = map(int, input().split())
C = K
count = 1
ans = "NG"

while (C<=B):
    #print("test")
    if(A<=C and C<=B):
        ans ="OK"
    C = K*count
    count += 1
    #print(C)


print(ans)

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

def f(a, b, n):
    fl1 = (a * (n + 1)) // b
    fl2 = (n + 1) // b
    fl = fl1 - (a * fl2)
    return fl
   #return int(a * n / b) - a * int(n / b)

print(f(A, B, B-1) if N >= B-1 else f(A, B, N))
Problem p02695 (python)

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

K= [list(map(int, input().split())) for i in range(Q)]#二次配列

ans = 0
for A in itertools.combinations_with_replacement([i for i in range(1, M + 1)], N):
    ans1 = 0
    for i in range(Q):
        a, b, c, d = K[i]#各数字に配列の値を代入する
        if (A[b - 1] - A[a - 1] == c):
            ans1 += d
        ans = max(ans, ans1)
print(ans)

Buggy submission (verdict: Runtime Error):
B = {}#辞書作成
N = int(input())
A = list(map(int, input().split()))


for i in range(N):
    B[i+1] = 0
#print(B)
for j in A:
    B[j] += 1
#print(B)
for k in B.values():
    print(k)

Buggy submission (verdict: Runtime Error):
import itertools
N, M, Q = map(int, input().split())

K= [list(map(int, input().split())) for i in range(Q)]#二次配列

ans = 0
for A in itertools.combinations_with_replacement([i for i in range(1, M + 1)], N):
    ans1 = 0
    for i in range(Q):
        a, b, c, d = K[i]　#各数字に配列の値を代入する
        if (A[b - 1] - A[a - 1] == c):
            ans1 += d
        ans = max(ans, ans1)
print(ans)
Problem p02707 (python)

Fixed submission:
B = {}#辞書作成
N = int(input())
A = list(map(int, input().split()))


for i in range(N):
    B[i+1] = 0
#print(B)
for j in A:
    B[j] += 1
#print(B)
for k in B.values():
    print(k)

Buggy submission (verdict: Runtime Error):
B = {}#辞書作成
N = int(input())
A = list(map(int, input().split()))


for i in range(N):
    #B[i+1] = 0
print(B)
for j in A:
    #B[j] += 1
print(B)
for k in B.values():
    print(k)

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

for i in range(1,N+1):
    B[i] = 0
for j in A:
    B[j] += 1
for k in B.values():
    print(k)

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

for i in range(N):
    B[i+1] = 0
for j in A:
    B[j] += 1
for k in B.values():
    print(k)

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

for i in range(N):
    B[i] = 0
for j in A:
    B[j] += 1
for k in B.values():
    print(k)

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

for i in range(N):
    B[i] = 0
for j in A:
    B[j] += 1
for k in B.values():
    print(k)
Problem p02552 (python)

Fixed submission:
x=int(input())
if x==0:
    print(1)
elif x==1:
    print(0)

Buggy submission (verdict: Runtime Error):
x=int(input())
if x==0:
    print(1)
elif x==1:
    print(0)
else:
    break
Problem p02819 (python)

Fixed submission:
import math

n = int(input())


def prime_checker(n):
    dest = int(math.sqrt(n))
    for i in range(2, dest):
        if n % i == 0:
            return False
    return True


while True:
    if prime_checker(n):
        print(n)
        break
    n += 1

Buggy submission (verdict: Runtime Error):
import sympy

n = int(input())

if sympy.isprime(n):
    print(n)
else:
    res = sympy.nextprime(n, 1)
    print(res)
Problem p02793 (python)

Fixed submission:
from fractions import gcd
from functools import reduce

mod = 10 ** 9 + 7

def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm(numbers):
    return reduce(lcm_base, numbers, 1)

# print('input >>')
N = int(input())
A = list(map(int,(input().split())))

lcmn = lcm(A)

ans = 0
for i in range(len(A)):
    ans += lcmn // A[i]

# print('-----output-----')
print(int(ans%mod))

Buggy submission (verdict: Runtime Error):
from fractions import gcd
from functools import reduce

mod = 10 ** 9 + 7

def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

# print('input >>')
N = int(input())
A = list(map(int,(input().split())))

lcmn = lcm(*A)

ans = 0
for A_ in A:
    ans += (lcmn / A_) % mod

# print('-----output-----')
print(int(ans%mod))
Problem p02833 (python)

Fixed submission:
import math
import sys

# print('input >>')
N = int(input())

if N % 2 == 1 or N == 0:
    print(0)
    sys.exit()

ans = 0
warusu = math.log(N, 5)
warusu = int(warusu)

for i in range(warusu):
    ans += (N // (5 ** (i+1))) // 2

# print('-----output-----')
print(ans)

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

# print('input >>')
N = int(input())

if N % 2 == 1:
    print(0)
    sys.exit()

ans = 0
warusu = math.log(N, 5)
warusu = int(warusu)

for i in range(warusu):
    ans += (N // (5 ** (i+1))) // 2

# print('-----output-----')
print(ans)
Problem p03011 (python)

Fixed submission:
L = list(map(int,input().split()))
L.sort()
print(L[0]+L[1])

Buggy submission (verdict: Runtime Error):
import sys
 
def fibo(n):
    a, b = 0, 1
    if n == 1:
        return 1
    else:
        for i in range(n):
            a0 = a
            a = b
            b = a0 + b
        return b
        
N, M = map(int, input().split())
a = []
 
if M == 0:
    print(fibo(N) % 1000000007)
    sys.exit()
 
for i in range(M):
    a.append(int(input()))
    
for j in range(len(a)-1):
    if a[j+1] - a[j] == 1:
        print(0)
        sys.exit()
    
hole = 0
pattern = 1
 
for i, k in enumerate(a):
    if i == 0:
        pattern *= fibo(k-1)
    else:
        if i > 0:
            pattern *= fibo(a[i]-a[i-1]-2)
        
pattern *= fibo(N-a[-1]-1)
print(pattern % 1000000007)