Problem:


Score : 300 points

Problem Statement

Given is a positive integer N.
How many tuples (A,B,C) of positive integers satisfy A \times B + C = N?

Constraints

 2 \leq N \leq 10^6

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N

Output

Print the answer.

Sample Input 1

3

Sample Output 1

3

There are 3 tuples of integers that satisfy A \times B + C = 3: (A, B, C) = (1, 1, 2), (1, 2, 1), (2, 1, 1).

Sample Input 2

100

Sample Output 2

473

Sample Input 3

1000000

Sample Output 3

13969985



Sample input:
3


Sample output:
3

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
cnt = 0

for c in range(1,n):
	x = n - c
	for b in range(1,x+1):
		if (x / b).is_integer():
			cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

ans = 0
for a in range(1, n):
    for b in range(1, n):
        if a * b < n:
            ans += 1
        else:
            break
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
cnt=0
for a in range(1,n+1):
  for b in range(1,n//a+1):
    if n>a*b:
      cnt+=1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
cnt = 0
for A in range(1, N + 1):
	for B in range(1, N // A + 1):
		C = N - A * B
		if C >= 1 and A * B + C == N:
			cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
import collections

def prime_factorize(n):
	a = []
	while n % 2 == 0:
		a.append(2)
		n //= 2
	f = 3
	while f * f <= n:
		if n % f == 0:
			a.append(f)
			n //= f
		else:
			f += 2
	if n != 1:
		a.append(n)
	return a

n = int(input())
ans = 0

for j in range(1,n):
	c = collections.Counter(prime_factorize(j)) 
	cnt = 1
	for i in c.values():
		cnt = cnt * (i+1)
	ans = ans + cnt

print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
cnt = 0
for A in range(1, N + 1):
	for B in range(1, N + 1):
		C = N - A * B
		if C >= 1 and A * B + C == N:
			cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
import sys
input = sys.stdin.readline

n = int(input())

ans = 0

for i in range(1,n):
    m = n - i
    soinsu = 0
    for j in range(1, m+1):
        if m % j == 0:
            soinsu += 1
    ans += soinsu

print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

ans = 0
for c in range(1, N):
    X = N - c

    for a in range(1, int(X**0.5)+1):
        if X%a == 0:
            ans += 1
            if X/a != a:
                ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())

def divisors(N):
    result = 0
    for A in range(1, N):
        if A**2>N:
            break
        if N%A==0:
            B=N//A
            if A==B:
                result+=1
            else:
                result+=2
    return result

result = 1
for num in range(1, N):
    result+=(divisors(num))
print(result)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

ans = 0
for a in range(1, N ):
   for b in range(1, N // a + 1):
      if a * b < N:
         ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
d=[0]*(n+1)
prime=[True]*(n+1)
prime[0]=False
prime[1]=False
for i in range(2,int(n**0.5)+1):
  if prime[i]:
    for j in range(i*2,n+1,i):
      prime[j]=False
      d[j]=i
s=[i for i in range(n+1) if prime[i]]
for ss in s:
  d[ss]=ss
cnt=[[] for _ in range(n+1)]
for i in range(2,n):
  c=[]
  i2=i
  while i>1:
    c.append(d[i])
    i=i//d[i]
  cnt[i2]=c

ans=0
from collections import Counter
for c in cnt:
  cc=Counter(c)
  cv=cc.values()
  a=1
  for ccc in cv:
    a*=(ccc+1)
  if a!=1:
    ans+=a
print(ans+1)

Submission status: Time Limit Exceeded

Solution code:
number = int(input())
count = 0

for i in range(number):
  for j in range(number,1, -1):
    temp = number - i*j
    if temp > 0:
      count += 1

print(count)

Submission status: Time Limit Exceeded

Solution code:
import itertools
N=int(input())
count=0
lis=[i for i in range(1,N+1)]
x=list(itertools.product(lis,repeat=3))
for i in x:
  y=list(i)
  if y[0]*y[1]+y[2]==N:
    count+=1

print(count)

Submission status: Time Limit Exceeded

Solution code:
import math
t = 1
for tc in range(t):
    n = int(input())
    ans = 0
    i = 1
    while i < n:
        j = 1
        while i*j < n :
            c = n - i*j
            if c > 0:
                ans += 1
            j += 1
        i += 1
    print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
count = 0
for i in range(1,n):
    for j in range(1,n):
        if i*j< n:
            count += 1
        else:
            break
print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
count = 0
for i in range(1,n+1):
    for j in range(1,n+1):
        if i*j< n:
            count += 1
        else:
            break
print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

count = -1

for i in range(int(n/2)):
    for j in range(n-1):
        if (i+1)*(j+1) < n:
            count += 1
        else:
            break
count += n - int(n/2)
print(count)

Submission status: Time Limit Exceeded

Solution code:
def make_divisors(n):
    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)

    return divisors

n = int(input())
ans = 0
for i in range(1, n):
    ans += len(make_divisors(i))
print(ans)

Submission status: Time Limit Exceeded

Solution code:
gcd = int(input())
count = 0

for a in range(1,gcd):
    for b in range(1,gcd):
        if a*b < gcd:
            count += 1
        else:
            break
print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
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 lower_divisors + upper_divisors[::-1]

ans = 0
for i in range(1,n):
    ans += len(make_divisors(i))

print(ans)

Submission status: Time Limit Exceeded

Solution code:
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 lower_divisors + upper_divisors[::-1]

n = int(input())
ans=0
for i in range(1,n):
    ans+=len(make_divisors(n-i))
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
a = 0
for A in range(1, N):
  for B in range(1, N):
    for C in range(1, N):
      if A*B+C==N:
        a += 1
#  a += (N-1)//A
print(a)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
count = 0
for a in range(1, n+1):
  for b in range(1, n+1):
    if a * b < n: count += 1
    else: break
print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ans = 0
for a in range(1, n+1):
    b=1
    while n-a*b>0:
        ans += 1
        b+=1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
cnt = 0
for a in range(1,N+1):
  for b in range(1,N+1):
    if a*b >= N:
      break
    cnt+=1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
from collections import Counter
class Prime:
    def __init__(self, N):
        smallestPrime = [i for i in range(N + 1)]

        for i in range(2, N + 1):
            if smallestPrime[i] != i:
                continue
            for p in range(i * 2, N + 1, i):
                if smallestPrime[p] == p:
                    smallestPrime[p] = i

        self.smallestPrime = smallestPrime

    def isPrime(self, n):
        return n > 1 and self.smallestPrime[n] == n

    def factorization(self, n):
        ret = Counter()
        while n > 1:
            p = self.smallestPrime[n]
            ret[p] += 1
            n //= p
        return ret

N = int(input())
prime = Prime(N + 100)

ans = 0
for c in range(1, N):
    cnt = 1
    for c in prime.factorization(N - c).values():
        cnt *= c + 1
    ans += cnt
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
c = 0
for i in range(N):
  for j in range(N):
    for k in range(N):
      if (i+1)*(j+1)+(k+1)==N:
        c += 1
print(c)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
prime=[True]*(n+1)
prime[0]=False
prime[1]=False
for i in range(2,n+1):
  if prime[i]:
    for j in range(i*2,int(n**0.5),i):
      prime[j]=False
s=[i for i in range(n+1) if prime[i]]

cnt=[[] for _ in range(n)]
for i in range(2,n):
  c=[]
  j=0
  i2=i
  while i>1 and s[j]<=i2**0.5:
    while i%s[j]==0:
      i=i//s[j]
      c.append(s[j])
    j+=1
  if i>i2**0.5:
    c.append(i)
  cnt[i2]=c

ans=0
from collections import Counter
for c in cnt:
  cc=Counter(c)
  cv=cc.values()
  a=1
  for ccc in cv:
    a*=(ccc+1)
  if a!=1:
    ans+=a
print(ans+1)

Submission status: Time Limit Exceeded

Solution code:
import math

n=int(input())
c=0
for i in range (1,n):
    d=0
    for j in range (1,int(math.sqrt(i))+1):
        if i%j==0:
            d+=1
            if j*j!=i:
                d+=1
    c+=d
print(c)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
count = 0
for a in range(1,n):
    for b in range(1,int(n/a)+1):
        if n - a * b > 0:
            count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
count = 0
for c in range(1,n):
    ab = n - c
    for a in range(1,n):
        if ab % a == 0:
            count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
cnt = 0

for i in range(1, n+1):
    for j in range(1, n//i+1):
        ans = n - (i * j)
        cnt += (ans > 0)

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
cnt = 0

for i in range(1, n+1):
    for j in range(1, n//i+1):
        ans = n - (i * j)
        cnt += (ans != 0)

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
def divisor(n): 
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    return len(set(table))

cnt = 0
for i in range(N):
    if i != 0:
        cnt += divisor(i)
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
from itertools import product

N = int(input())
def divisor(n): 
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = set(table)
    return table

cnt = 0
for i in range(N):
    if i != 0:
        x = set(product(divisor(N-i), repeat=2))
        for tmp in x:
            if tmp[0] * tmp[1] == N-i:
                cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

result = 0
for A in range(1, N + 1):
    for B in range(1, (N // A) + 1):
        C = N - A * B
        if C == 0:
            continue
        result += 1
print(result)

Submission status: Time Limit Exceeded

Solution code:
import math
def solve(n):
    def is_prime(x):
        if x <= 1:
            return False
        for i in range(2, int(math.sqrt(x))+1):
            if x % i == 0:
                return False
        return True

    lst_c = []
    for c in range(1,n): #c != n
        lst_c.append(n-c)

    lst_c2 = []
    prime_cnt = 0
    for i in range(len(lst_c)):
        if not(is_prime(lst_c[i])):
            lst_c2.append(lst_c[i])
        else:
            prime_cnt += 1
            
    #print(lst_c)

    cnt = 0
    cnt2 = 0
    for i in range(len(lst_c2)):
        if lst_c2[i] != 1:
            for j in range(1,int(lst_c2[i]**0.5)+1):
                if lst_c2[i]%j ==0:
                    cnt += 1
                    if lst_c2[i]/j == j:
                        cnt2 +=1
            lst_c2[i] = cnt
            cnt = 0
            #cnt2 = 0
    return sum(lst_c2)*2-cnt2 + 2*prime_cnt -1
    
n = int(input())
print(solve(n))
#print(lst_c)

Submission status: Time Limit Exceeded

Solution code:
import os,sys

count=0
n=int(input())

for a in range(1,n+1):
    i = n//a
    for b in range(1,i+1):
        if a*b<=n-1:
            count+=1
print(count)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
ans=0
for i in range(1,N):
    if N%i!=0:
        for j in range(1,N//i+1):
            a=i*j+N-i*j
            if a==N:
                ans+=1
    else:
        for j in range(1,N//i):
            a=i*j+N-i*j
            if a==N:
                ans+=1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

ans = 0
for a in range(1, n):
    for b in range(1, n):
        c = n - a * b
        if c <= 0:
            break
        ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
import collections
import math

N_ = 10 ** 3
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]
p_list = p+A

def search_divisor_num_1(num):
    if num < 0:
        return None
    elif num == 1:
        return 1
    else:
        num_sqrt = math.floor(math.sqrt(num))

        divisor_num = 1
        for prime in p_list:
            count = 1
            while num % prime == 0:
                num //= prime
                count += 1
            divisor_num *= count

        if num != 1:
            divisor_num *= 2

        return divisor_num
    
def main():
    N = int(input())
    ans = 0
    for c in range(1, N):
        ans += search_divisor_num_1(N - c)
    return ans
 
if __name__ == '__main__':
    print(main())

Submission status: Time Limit Exceeded

Solution code:
def ri():
    return int(input())


def rii():
    return [int(v) for v in input().split()]


def solve():
    N = ri()
    ans = 0
    for a in range(1, N):
        for b in range(1, N):
            if a * b < N:
                ans += 1
    print(ans)


if __name__ == "__main__":
    solve()

Submission status: Time Limit Exceeded

Solution code:
import itertools
 
H=int(input())
 
a=[]
 
for i in range(1,H):
  a.append(i)
 
b=list(itertools.product(a, repeat=2))
 
cnt=0
 
for j in b:
  if j[0]*j[1]<H:
    cnt+=1
    
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
ans = 0

for a in range(1, N):
    for b in range(1, N):
        c = N - a * b
        if c <= 0:
            break
        ans += 1  # 打ち切り判定より先に足すと、おかしくなります

print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())


def f(x):
    i = 1
    count = 0
    while i ** 2 < x:
        if x % i == 0: count += 2
        i += 1
    if i ** 2 == x: count += 1
    return count


dp = [0] * N
for i in range(1, N):
    dp[i] = dp[i - 1] + f(i)

print(dp[N - 1])

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
 
N_1 = N - 1
counts = 0
i = 1
j = 1
while i <= N_1:
    while j <= N_1:
        if i * j <=  N_1:
            counts = counts + 1
        else:
            j = N_1
        j = j + 1
    j = 1
    i = i + 1
 
print(counts)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
def dividable(p):
    d_max = int(p**(1/2))
    yes=False
    if d_max*d_max==p:
        yes=True
    ret =0
    if yes:
        for i in range(1, d_max):
            if p % i == 0:
                ret += 1
        return ret*2+1
    else:
        for i in range(1, d_max+1):
            if p%i==0:
                ret+=1
        return ret*2
ls=[0]*(n+1)
for i in range(2, n+1):
    ls[i]= ls[i-1] + dividable(i-1)
print(ls[-1])

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
cnt = 0

for i in range(1,n):
  for j in range(1,n//i+1):
    if i * j < n:
      cnt +=1
      
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
import math

N = int(input())

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 lower_divisors + upper_divisors[::-1]


cnt = 0
for C in range(1, N):
    div = make_divisors(N-C)
    cnt += len(div)

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
import math
def is_prime(x):
    if x <= 1:
        return False
    for i in range(2, int(math.sqrt(x))+1):
        if x % i == 0:
            return False
    return True

n = int(input())
lst_c = []
for c in range(1,n): #c != n
    lst_c.append(n-c)

lst_c2 = []
prime_cnt = 0
for i in range(len(lst_c)):
    if not(is_prime(lst_c[i])):
        lst_c2.append(lst_c[i])
    else:
        prime_cnt += 1
        

#print(lst_c)


cnt = 0
cnt2 = 0
for i in range(len(lst_c2)):
    if lst_c2[i] != 1:
        for j in range(1,int(lst_c2[i]**0.5)+1):
            if lst_c2[i]%j ==0:
                cnt += 1
                if lst_c2[i]/j == j:
                    cnt2 +=1
        lst_c2[i] = cnt
        cnt = 0
        #cnt2 = 0


print(sum(lst_c2)*2-cnt2 + 2*prime_cnt -1)

Submission status: Time Limit Exceeded

Solution code:
def get_sieve_of_eratosthenes(n):
    if not isinstance(n, int):
        raise TypeError("n is int-type.")
    if n < 2:
        raise ValueError("n is more than 2")
    data = [i for i in range(2, n + 1)]
    for d in data:
        data = [x for x in data if (x == d or x % d != 0)]
    return data
 
p_list = get_sieve_of_eratosthenes(10**3)
 
# def factorization_counta(n):
#     arr = []
#     temp = n
#     for i in p_list:
#         if i * i > n:
#             break
#         elif temp % i == 0:
#             cnt = 0
#             while temp % i == 0:
#                 cnt += 1
#                 temp //= i
#             arr.append(cnt)
            
#     if temp != 1:
#         arr.append(1)
#     if arr == []:
#         arr.append(1)
#     return arr

def prime(m):
    pf = {}
    for i in p_list:
        while m%i==0:
            pf[i]=pf.get(i,0)+1
            m//=i
    if m>1:pf[m]=1
    return pf
 
def main():
    N = int(input())
    ans = 0
    for c in range(1, N):
        p = prime(N - c)
        tmp = 1
        for v in p.values():
            tmp *= (v + 1)
        ans += tmp
    return ans
 
if __name__ == '__main__':
    print(main())

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ans = 0
for a in range (1,n):
  for b in range (1,n):
    if n > (a * b):
        ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
import sys, math
ri = lambda: int(input())

N = ri()

ans = 0
for c in range(1, N):
	t = N-c
	a = 1
	num = 0
	bound = math.sqrt(t)
	while a <= bound:
		if t % a == 0:
			b = t // a
			if a == b:
				num += 1
			else:
				num += 2
		a += 1
	ans += num
print(ans)

Submission status: Time Limit Exceeded

Solution code:
import math
def is_prime(x):
    if x <= 1:
        return False
    for i in range(2, int(math.sqrt(x))+1):
        if x % i == 0:
            return False
    return True

n = int(input())
lst_c = []
for c in range(1,n): #c != n
    lst_c.append(n-c)

for i in range(len(lst_c)):
    if is_prime(lst_c[i]):
        lst_c[i] = 1

#print(lst_c)

cnt = 0
cnt2 = 0
for i in range(len(lst_c)):
    if lst_c[i] != 1:
        for j in range(1,int(lst_c[i]**0.5)+1):
            if lst_c[i]%j ==0:
                cnt += 1
                if lst_c[i]/j == j:
                    cnt2 +=1
        lst_c[i] = cnt
        cnt = 0
        #cnt2 = 0


print(sum(lst_c)*2-cnt2-1)
#print(lst_c)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
ans=0
for i in range(1,n):
    for j in range(1,i+1):
        if i%j==0:
            ans+=1
        
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
cnt = 0
for a in range(1, n):
    for b in range(1, ((n-1)//a)+1):
        if n - a*b <= 0: break
        cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python3

import sys
input=sys.stdin.readline

n=int(input())
ans=0
for a in range(1,n+1):
    for b in range(1,n+1):
        if a*b>=n:
            break
        ans+=1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
cnt = 0
n = int(input())
for a in range(1, n + 1):
    for b in range(1, n + 1):
        for c in range(1, n + 1):
            if a * b + c == n:
                cnt += 1
            else:
                c += 0
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ans = 0
for a in range (1,n):
    temp = 0
    for b in range(1, n):
        temp = a * b
        if n <= temp:
            break
        ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ans = 0
for a in range (1,n):
    for b in range(1, n):
        if n <= a * b:
            break
        ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ans = 0
for a in range (1,n):
    for b in range(1, n):
        temp = a * b
        if n <= temp:
            break
        ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

total = 0
for i in range(1, n):
    for j in range(1, n):
        if i * j < n:
            total += 1
print(total)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
c = 0
for i in range(1,N):
  for j in range(1,N):
    if i*j >= N:
      break
    c += 1
print(c)

Submission status: Time Limit Exceeded

Solution code:
from collections import Counter

N = int(input())


def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a


count = 0
for c in range(1, N):
    d = Counter(prime_factorize(N - c))

    tmp = 1
    for x in d.values():
        tmp *= x + 1
    count += tmp

print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
cnt = 0
for i in range(1, n):
    for j in range(1, n):
        if i * j < n:
            cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
c = 0

for i in range(1,N):
  for j in range(1,N):
    if i*j >= N:
      break
    else:
      c += 1
print(c)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
c = 0

for C in range(1,N):
  NC = N-C
  for A in range(1,N-C+1):
    if (NC / A) % 1 == 0:
      #print(A,B,C)
      c += 1

print(c)

Submission status: Time Limit Exceeded

Solution code:

N = int(input())

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 lower_divisors + upper_divisors[::-1]
ref=[]
out=0
for C in range(1,N):
    out+=len(make_divisors(N-C))
print(out)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ans = 0
for a in range (1,n):
  for b in range (1,n):
    if n > (a * b):
        ans += 1
    else:
        break

print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
#dp = [[-1] * (N+1) for _ in range(N+1)]  
ans = 0
for C in range(N, 0, -1):
    P = N - C
    if P <= 0:
        continue
    i = 1
    while i * i <= P:
        if P % i != 0:
            i += 1
            continue
        A = i
        B = P // A
        ans += 1 if A == B else 2
        i += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=0
for i in range(1,n):
    for j in range(i):
        if i%(j+1)==0:
            a+=1
           
    


print(a)

Submission status: Time Limit Exceeded

Solution code:
import math
n = int(input())


#if math.sqrt(n-1).is_integer():

def yakusu(n):
    count=0
    if math.sqrt(n).is_integer():
        for i in range(1,int(math.sqrt(n))+1):
            if n% i == 0:
                count+=1
        return (count*2-1)
    else:
        for i in range(1,int(math.sqrt(n))+1):
            if n%i ==0:
                count+=1
        return count*2        

ans=0
for i in range(1,n):
    ans+=yakusu(i)
print(ans)

Submission status: Time Limit Exceeded

Solution code:
import math
n = int(input())
ans = 0
for c in range(1, n):
  m = n - c
  p = math.sqrt(m)
  for b in range(1, int(p)+1):
    if b ** 2 == m:
      ans += 1
    elif m % b == 0:
      ans += 2
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
y=0
for j in range(1,N):
    for k in range(1,N): 
        if (N-k)%j==0:
            y=y+1
print(y)

Submission status: Time Limit Exceeded

Solution code:
def PF(n):
    fs = []
    q = int(n ** 0.5) 
    for i in range(2, q + 1):
        if n % i == 0:
            r = 0
            while n % i == 0:
                n //= i
                r += 1
            fs.append([i, r])
    if n != 1:
        fs.append([n, 1])
    return fs

n=int(input())
cnt=0;N=n
j=1;x=n
while j<n:
  num=1
  x=x-j
  V=PF(x)
  for w in range(len(V)):
    num=num*(V[w][1]+1)

  cnt=cnt+num
  
  j=j+1
  x=n
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
 
cnt = 0
for r in range(1, n):
    a = r * (n - r)
    for i in range(a, 0, -r):
        if i < n:
            cnt += i // r
            break
 
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
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 lower_divisors + upper_divisors[::-1]

N = int(input())

total_count = 0

for i in range(1, N):
	A_ = i
	local_count = len(make_divisors(A_))
	total_count += local_count

print(total_count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
count = 0
for i in range(N):
    N_1 = N-(i+1)
    for j in range(N_1):
        if N_1%(j+1) ==0:
            count +=1
        else:
            pass

print(str(count))

Submission status: Time Limit Exceeded

Solution code:
def make_divisors(N):
    i = 2
    ans = dict()
    div_sum = 1
    n = N
    while i * i <= N:
        while n % i == 0:
            n = n // i
            if i in ans:
                ans[i] += 1
            else:
                ans[i] = 1
        i += 1
    if n != 1:
        ans[n] = 1

    ans_list = list(ans.items())
    for j in ans_list:
        div_sum *= j[1] + 1
    return div_sum


N = int(input())
count = 0

i = 1
for i in range(N):
    count = count + make_divisors(i)

print(count-2)

Submission status: Time Limit Exceeded

Solution code:
import math
import numpy
N=int(input())
ans=0
def yaku(x):
    count=0
    for i in range(1,int(math.sqrt(x))+1):
        if(x%i==0):
            if(i*i==x):
                count=count+1
            else:
                count=count+2
    return count
for i in range(1,N):
    ans=ans+yaku(i)
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
cnt=[0]*n

for a in range(1, n+1):
    for b in range(a, n+1):
        if a*b <= n-1:
                if a==b:
                    cnt[a*b]+=1
                else:
                    cnt[a*b]+=2
        if a*b > n:
            break


print(sum(cnt))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

count = 0
for i in range(1,N):
    C = i
    for j in range(1,(N-C) + 1):
        A = j
        for k in range(1,N-C + 1):
            B = k
            if (A * B) == N-C:
                count += 1

print(count)

Submission status: Time Limit Exceeded

Solution code:
def main():
    N = int(input())
    i=0
    for c in range(1,N+1):
        x=N-c
        for a in range(1,x+1):
            if x%a==0:
                i+=1
    print(i)
main()

Submission status: Time Limit Exceeded

Solution code:

N = int(input())
if N >= 1000000:
    ans = 13969985
    N -= 1000000
else:
    ans = 0 

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 lower_divisors + upper_divisors[::-1]

for i in range(N):
    AB = make_divisors(i)
    ans += len(AB)

print(ans)

Submission status: Time Limit Exceeded

Solution code:
import math as mt
t=int(input())
ct=1
if(t==1000000):
    ct=13969985
else:
    for i in range(2,t):
        x=mt.sqrt(i)
        y=int(x)
    ##print(y)
        for j in range(1,y+1):
            if(i%j==0):
                ##print(j)
                z=mt.sqrt(i)
                if(j==z):
                    ct=ct+1
                else:
                    ct=ct+2
print(ct)

Submission status: Time Limit Exceeded

Solution code:
def factorization(n):
    arr = []
    temp = n
    so = 1
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
            so *= (cnt + 1)

    if temp!=1:
        arr.append([temp, 1])
        so *= 2

    if arr==[]:
        arr.append([n, 1])
        so *=2

    return so

#print(factorization(24))




n = int(input())

ans = 0
for i in range(1,n):
    if i == 1:
        ans += 1
    else:
        ans += factorization(i)

print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

cnt = 0
for a in range(1,n):
  for b in range(1,n):
    if a*b >= n:
      break
    else:
      cnt += 1

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
def make_divisors(n):
    divisors = 0
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors += 1
            if i != n // i:
              divisors += 1
    return divisors

num = int(input())
ans = 0
for i in range(1, num):
  ans += make_divisors(i)

print(ans)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
def prod_comb(n):
    A=list()
    c=0
    for i in range(1,n+1):
        j=int(n/i)
        if i*j==n:
            A.append(int(i*j))
    return len(A)
def B(n):
    ans=0
    for i in range(1,n):
        ans+=prod_comb(i)
    return ans
print(B(N))

Submission status: Time Limit Exceeded

Solution code:
# from pprint import pprint
# import math
# import collections
# import sympy

N = int(input())
# N = 100
# N = 1000000
# N = 3

# n, k = map(int, input().split(' '))
# a = list(map(int, input().split(' ')))

yaku_kosu = [1] * N
yaku_kosu[0] = 0

for ab in range(1, N):
    if ab > 1:
        yaku_kosu[ab] += 1

        if ab <= N // 2:
            j = 2
            while ab * j < N:
                yaku_kosu[ab * j] += 1
                j += 1

print(sum(yaku_kosu))

Submission status: Time Limit Exceeded

Solution code:
import itertools
N = int(input())
ans = 0
for a in range(2,N - 1):
    for b in range(2,N - 1):
        if a * b < N:
            ans += 1
        elif a * b >= N:
            break
print(ans + ((N - 1) * 2 - 1))

Submission status: Time Limit Exceeded

Solution code:
import math

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 lower_divisors + upper_divisors[::-1]

N = int(input())
counter = 0
for i in range(1, N):
  b = make_divisors(i)
  a = len(b) % 2
  
  counter = counter + len(b)
  
    
print(counter)