Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
def count_divisor(n):
    i, count = 1, 0
    while i * i <= n:
        if n % i == 0:
            if i * i == n:
                count += 1
            else:
                count += 2
        i += 1
    return count
ans=0
for k in range(1,n+1):
    ans+=k*count_divisor(k)
print(ans)

Fixed submission:
N=int(input())
ans=(N*(N+1))//2  #1の時
for i in range(2,N+1):
  m=N//i
  ans+=i*(m*(m+1)//2)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
def factorization(n):
    def factor_sub(n, m):
        c = 0
        while n % m == 0:
            c += 1
            n /= m
        return c, n
    #
    buff = []
    c, m = factor_sub(n, 2)
    if c > 0: buff.append((2, c))
    c, m = factor_sub(m, 3)
    if c > 0: buff.append((3, c))
    x = 5
    while m >= x * x:
        c, m = factor_sub(m, x)
        if c > 0: buff.append((x, c))
        if x % 6 == 5:
            x += 2
        else:
            x += 4
    if m > 1: buff.append((m, 1))
    return buff
def divisor_num(n):
    a = 1
    for _, x in factorization(n):
        a *= x + 1
    return a
N=int(input())
ans=0
li=[i for i in range(1,N+1)]
for i in range(1,N+1):
  ans+=divisor_num(i)*i
print(ans)


Fixed submission:
N=int(input())
ans=(N*(N+1))//2  #1の時
for i in range(2,N+1):
  m=N//i
  ans+=i*(m*(m+1)//2)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
def num_divisors_table(n):
    table = [0] * (n + 1)
    
    for i in range(1, n + 1):
        for j in range(i, n + 1, i):
            table[j] += 1
       
    return table[-1]
N=int(input())
ans=0
li=[i for i in range(1,N+1)]
for i in range(1,N+1):
  ans+=num_divisors_table(i)*i
print(ans)


Fixed submission:
N=int(input())
ans=(N*(N+1))//2  #1の時
for i in range(2,N+1):
  m=N//i
  ans+=i*(m*(m+1)//2)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
def num_divisors_trial_division(n):
    num = 0
    for i in range(1, int(math.sqrt(n) + 1e-9) + 1):
        if n % i == 0:
            num += 1
            if n != i**2:
                num += 1
    
    return num
N=int(input())
ans=[]
li=[i for i in range(1,N+1)]
for i in range(1,N+1):
  ans.append(num_divisors_trial_division(i))
print(sum([a*b for a,b in zip(ans,li)]))


Fixed submission:
N=int(input())
ans=(N*(N+1))//2  #1の時
for i in range(2,N+1):
  m=N//i
  ans+=i*(m*(m+1)//2)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
def num_divisors_trial_division(n):
    num = 0
    for i in range(1, int(math.sqrt(n) + 1e-9) + 1):
        if n % i == 0:
            num += 1
            if n != i**2:
                num += 1
    
    return num
N=int(input())
ans=0
for i in range(1,N+1):
  ans+=num_divisors_trial_division(i)*i
print(ans)


Fixed submission:
N=int(input())
ans=(N*(N+1))//2  #1の時
for i in range(2,N+1):
  m=N//i
  ans+=i*(m*(m+1)//2)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
def num_divisors_trial_division(n):
    num = 0
    for i in range(1, int(math.sqrt(n) + 1e-9) + 1):
        if n % i == 0:
            num += 1
            if n != i**2:
                num += 1
    
    return num
N=int(input())
ans=0
for i in range(1,N+1):
  ans+=num_divisors_trial_division(i)*i
print(ans)


Fixed submission:
N=int(input())
ans=(N*(N+1))//2  #1の時
for i in range(2,N+1):
  m=N//i
  ans+=i*(m*(m+1)//2)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return len(lower_divisors + upper_divisors[::-1])
N=int(input())
ans=0
for i in range(1,N+1):
  ans+=make_divisors(i)*i
print(ans)

Fixed submission:
N=int(input())
ans=(N*(N+1))//2  #1の時
for i in range(2,N+1):
  m=N//i
  ans+=i*(m*(m+1)//2)
print(ans)

Buggy python submission (verdict: Runtime Error):
import sympy
N=int(input())
ans=0
for i in range(1,N+1):
  ans+=sympy.divisor_count(i)*i
print(ans)

Fixed submission:
N=int(input())
ans=(N*(N+1))//2  #1の時
for i in range(2,N+1):
  m=N//i
  ans+=i*(m*(m+1)//2)
print(ans)