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())
point=0

for a in range(1, n):
  b=1
  while a*b<n:
    b+=1
    point+=1

print(point)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
sum=0
def factorization(n):
    arr = []
    temp = n
    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(cnt)

    if temp!=1:
        arr.append(1)

    if arr==[]:
        arr.append(1)

    return arr
for i in range(1,N):
    list0=factorization(i)
    X=1
    for k in range(len(list0)):
        X *= list0[k]+1
    sum+=X
print(sum-1)

Submission status: Time Limit Exceeded

Solution code:
import math

N = int(input())
counter = 0
for i in range(2, N):
  a = math.ceil(i/2)
  for j in range(2, a + 1):
    if i % j == 0:
      if i == j*j:
        counter = counter + 1
      else:
        counter = counter + 1
counter = counter + 2*(N-2) + 1
print(counter)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
c = 1
count = 0
while n - c > 0:
    for a in range(n - c):
        b = (n-c) / (a+1)
        if b.is_integer():
            count += 1
    c += 1
print(count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import os,sys

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

Submission status: Time Limit Exceeded

Solution code:
import numpy as np

N = int(input())
i=0
c= np.arange(1,N+1)
x=N-c
x=x[~(x == 0)]
for a in np.arange(1,N+1):
    i+=np.count_nonzero(x%a==0)
print(i)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

import math

def num_pair(n):
  res = 2 # 1 x n, n x 1
  for i in range(2, int(math.sqrt(n)) + 1):
    if n % i == 0:
      res += 2
  if int(math.sqrt(n)) ** 2 == n:
    res -= 1
  return res

# a x b + c == n
# n - c == a x b

res = 0
for i in range(1, N):
  res += num_pair(i)

print(res)

Submission status: Time Limit Exceeded

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

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

for i in range(1, N):
    list_ab = divisor(N - i)
    ans += len(list_ab)

print(int(ans))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a=1
x=0
for i in range(n-1):
    b=1
    while a*b < n:
        x += 1
        b += 1
    a += 1
print(x)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
#
# 179C
#
n = input()
n = int(n)

c = 0
for i in range(n):
    j = i+1
    k = 1
    while True:
        if j*k<n:
            c = c+1
        else:
            break
        k = k+1

print(c)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
out = 0
for A in range(1,N+1):
    for B in range(1,N+1):
        if A * B >= N:
            break
        else: out += 1
print(out)

Submission status: Time Limit Exceeded

Solution code:
import math

def make_divisors(n):
    d = 0
    i = 1
    d2 = True
    m = int(math.sqrt(n))
    for i in reversed(range(1, m + 1)):
        if n % i != 0:
            continue
        if i * i == n:
            d += 1
        else:
            d += 2
    return d


def f(n):
    count = 0
    for i in range(1, n):
        count += make_divisors(n - i)
    return count


def main():
    print(f(int(input())))


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

N = int(input())
s = 0
for i in range(1, N):
  d = len(divisor(i))
  s += d
print(s)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
c = 1
count = 0
while n - c > 0:
    a = 0
    for a in range(n - c):
        b = (n-c) / (a+1)
        if b.is_integer():
            count += 1
    c += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
a=1
count=0
while a<N:
  b=1
  #print(a,b)
  for i in range(N//a+1):
    c=N-a*b
    if c>0:
      count+=1
      #print(a,b,c)
    b+=1
  a+=1
print(count)

Submission status: Time Limit Exceeded

Solution code:
def readInt():
    return int(input())
def readList():
    return list(map(int,input().split()))
def readMap():
	return map(int,input().split())
def readStr():
    return input()
inf=float('inf')
mod = 10**9+7
import math
from itertools import permutations
def solve(N):
    return sum(find_factors(i) for i in range(1,N))

def find_factors(num):
    i=1
    count=0
    while i*i<=num:
        if num%i==0:
            count+=1
            if num//i!=i:
                count+=1
        i+=1
    return count
N=readInt()
print(solve(N))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ans = 0
for c in range(1, n):
    temp = n - c
    ls = []
    for a in range(1, int(temp/2) + 2):
        if temp % a == 0 and (not a in ls):
            ans += 2
            ls.append(a)
            ls.append(int(temp / a))
            if temp == a * a:
                ans -= 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
import sys
n = int(sys.stdin.readline().strip())

eroot_n = int(pow(n, 0.5))
res = 0
for num_a in range(1, eroot_n + 1):
    for num_b in range(num_a, n):
        """
        print(num_a)
        print(num_b)
        print('\n')
        """
        if num_a * num_b >= n:
            continue
        if num_a == num_b:
            res = res + 1
        else:
            res = res + 2
print(res)

Submission status: Time Limit Exceeded

Solution code:
import math
N=int(input())
sum=0

def make_prime_list_2(num):
    if num < 2:
        return []

    # 0のものは素数じゃないとする
    prime_list = [i for i in range(num + 1)]
    prime_list[1] = 0 # 1は素数ではない
    num_sqrt = math.sqrt(num)

    for prime in prime_list:
        if prime == 0:
            continue
        if prime > num_sqrt:
            break

        for non_prime in range(2 * prime, num, prime):
            prime_list[non_prime] = 0

    return [prime for prime in prime_list if prime != 0]

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

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

        if num != 1:
            divisor_num *= 2

        return divisor_num

for c in range(1,N):
    sum+=search_divisor_num_1(c)
print(sum)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())


ans = 0
divisors = []

for n in range(1,N):
    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)
            
        
print(len(divisors))

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 and a*b+c == N:
            ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

ans = 0
for c in range(1,n):
    for ab in range(1,int(1+(n-c+1)**(1/2))):
        if ((n-c)/(ab)).is_integer() and  ((n-c)/(ab))==(ab):
            ans+=1
        elif ((n-c)/(ab)).is_integer() and ((n-c)/(ab))!=(ab):
            ans+=2

print(ans)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())

point=0
for c in range(1,n):
  a=1
  while n-c>=a:
    if (n-c)%a==0:
      point+=1
    a+=1
    
print(point)

Submission status: Time Limit Exceeded

Solution code:
import math
int = int(input())
ab = []
sum = 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(int):
    ab = int - (i + 1)
    b = len(make_divisors(ab))
    smsum = math.ceil(b)
    sum += smsum

print(sum)

Submission status: Time Limit Exceeded

Solution code:

n = int(input())

cnt = 0
for a in range(n-1):
    for b in range(n-1):
        for c in range(n-1):
            if (a+1) * (b+1) + (c+1) == n :
                cnt += 1
            
print(cnt)

Submission status: Time Limit Exceeded

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

for c in range(1,n):
    ab = n - c
    for i in range(1, int(math.sqrt(ab)) + 1):
        if ab % i == 0:
            ans += 1
            if ab != i**2:
                ans += 1

print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())

count = 0

for c in range(n):
    if c==0:
        continue
    for a in range(n):
        if a==0:
            continue
        for b in range(n):
            if b==0:
                continue
            if (a*b)+c == n:
                count += 1
else:
    print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

nc_lst = [i for i in range(1, n)]
count = 0

for i in range(len(nc_lst)):
    nc = nc_lst[i]
    for j in range(1, nc + 1):
        if nc // j == nc / j:
            count += 1
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]


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:
n= int(input())
ans=0
nn = int((n-1)//2)+1
for i in range(2,nn):
    for j in range(2,nn):
        if i*j>n-1:
            break
        else:
            ans += 1

ans += (n-1-1)*2
print(ans+1)

Submission status: Time Limit Exceeded

Solution code:
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    cnt = 0
    while i*i <= n:
        if n % i == 0:
            cnt+=1
            if i != n // i:
                cnt+=1
        i += 1
    return cnt
N = int(input())
cnt = 0
for i in range(1,N):
    cnt += make_divisors(i)
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
cnt=1;N=n
p=0;q=0;a=1;b=1;c=1
j=1
while j<n:
  N=N-j
  S=[]
  i=1
  while i<N:
    if N%i==0:
      if S.count(i)==0:
        S.append(i)
      if S.count(N//i)==0:
        S.append(N//i)
    i=i+1
  cnt=cnt+len(S)
  #print(j,len(S),S,cnt)
  j=j+1
  N=n
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
def solution():
  N = int(input())
  cnt = 0
  for C in range(1, N):
    AB = N - C
    for A in range(1, N):
      if (AB) % A == 0:
        B = int(AB / A)
        cnt += 1
  return cnt
print (solution())

Submission status: Time Limit Exceeded

Solution code:
from sys import stdin
input=stdin.readline
n=int(input().rstrip())
count=0
for i in range(1,n):
    
    for t in range(1,n):
        if n-i*t>0:
            count +=1
        else:
            break
print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
count = 0
a = 1
num = int(n/2) if n % 2 == 0 else int(n/2 +1)
for i in range(1,n):
    while a**2 <= n-i:
        if (n-i) % a == 0:
            if int((n-i)/a) == a:
                count += 1
            else:
                count += 2
        a += 1
    a = 1
    
print(count)

Submission status: Time Limit Exceeded

Solution code:
import collections

def trial_division(n):
    if n < 3:
        return 1
    # prime_factors = []
    product_sum=1
    for i in range(2, int(n**0.5)+1):
        # 個々で i で複数回割り切れるのなら割り切る．
        count = 0
        while n % i ==0:
            # prime_factors.append(i)
            n //= i
            count += 1
        product_sum*=(count+1)
    if n > 1:
        # prime_factors.append(n)
        product_sum*=(1+1)
    return product_sum


N = int(input())
if(N==2):
    print(1)
    exit()
sum0=0
for n in range(1, N):
    sum0 += trial_division(n)
# print(ans)
print(sum0+1)

Submission status: Time Limit Exceeded

Solution code:
import math
a = 0
N = int(input())
for i in range(1, N):
  for j in range(1, math.floor(i ** 0.5) + 1):
    if i % j == 0:
      if j == i / j:
        a += 1
      else:
        a += 2
print(a)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ans = 0
for c in range(1, n):
  m = n - c
  for b in range(1, n):
    if m % b == 0:
      ans += 1

print(ans)

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):
    count = len(make_divisors(N-i))
    ans += count
    # print(N-i, end='')
    # print('の約数の個数は')

    # print(count)
    # if count % 2 == 0:
    #     ans += count*2
    # else:
    #     ans += 1 + (count-1)*2
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

ans = 0
k = N
for A in range(1, N):
    for B in range(1, N):
        if A * B < N:  # 大きさ比較なので計算早いか？
            ans += 1
        else:
            break  # 値大きくなったらもう次のAに

print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ans = 0
flag = 0
c = 0

for i in range(1,n):
    flag = 0
    c = 0
    for j in range(1,i+1):
        if i % j == 0:
            if i / j == j:
                c *= 2
                c += 1
                ans += c
                break
            if j == flag:
                c *= 2
                ans += c
                break
            flag = j
            c += 1
    else:
        ans += c
        
print(ans)

Submission status: Time Limit Exceeded

Solution code:
import functools
def nu_of_factors2(n):
    return len(set(functools.reduce(list.__add__,
            ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0))))

N = int(input())
counter = 0
for i in range(1,N):
    checker = N - i
    counter += nu_of_factors2(checker)
print(counter)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

total = 0

for i in range(1,n):
  c = n-i
  for j in range(c):
    if c % (j + 1) ==0:
      total += 1
print(total)

Submission status: Time Limit Exceeded

Solution code:
import os,sys

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

ans = 0

for a in range(1, N):
    cnt = 0
    for b in range(1, N):
        if a * b < N:
            if a < b:
                cnt += 2
            elif a == b:
                cnt += 1
        else:
            break
    
    ans += cnt

print (ans)

Submission status: Time Limit Exceeded

Solution code:
num = int(input())
count = 0
ll = []
for i in range(1,num+1):
  for j in range(1,num+1):
    for k in range(1,num+1):
      ll.append([i,j,k])

for l in ll:
  if l[0]*l[1]+l[2] == num:
    count += 1
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())
abc=n
ans=0
for c in range(1,n):
  ab=abc-c
  ans+=len(make_divisors(ab))

print(ans)

Submission status: Time Limit Exceeded

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

for i in range(1,N):
    for j in range(1,N):
        if i*j<N:
            ans+=1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
D =0
A = 1
while A < N:
    B = 1
    while A*B < N:
        B += 1
        D += 1
    A += 1
print(D)

Submission status: Time Limit Exceeded

Solution code:
# cording:utf-8

# Nを入力
N = int(input())

cnt = 0

for i in range(1, N+1):
    # Aがiの時

    for j in range(1, N+1):
        # Bがjの時

        if (i * j) > N:
            break

        if (N - i * j) > 0:
            cnt = cnt + 1

print(cnt)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
gcd = int(input())
count = 0
for a in range(gcd):
    for b in range(gcd):
        for c in range(gcd):
            if a*b+c == gcd:
                count += 1
for a in range(gcd):
    for b in range(gcd):
        if a*b == gcd:
            count -= 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np

N = int(input())


def search_prime_num(x):
    max = int(np.sqrt(x))
    seachList = [i for i in range(2, x + 1)]
    primeNum = []
    while seachList[0] <= max:
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    return primeNum


factor_list = search_prime_num(N)


def factorization(n):
    arr = []
    temp = n
    for i in factor_list:
        if i > int(-(-n**0.5//1))+1:
            break
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

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

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

    return arr


ans = 1

for j in range(2, N):
    factors = factorization(j)
    buf = 1
    for factor in factors:
        buf *= (factor[1] + 1)
    ans += buf

print(ans)

Submission status: Time Limit Exceeded

Solution code:
k=int(input())


cnt=0
if k>3:
    for i in range(3,k):
        for j in range(1,k):
            
                
            if i*j<k:
                cnt+=1
            else:
                break
print(cnt+k-1+((k-1)//2))

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 len(lower_divisors + upper_divisors[::-1])
a=0
for j in range(n):
    a+=make_divisors(j)
print(a)

Submission status: Time Limit Exceeded

Solution code:
def make_divisors(n):
    cnt = 0
    i = 1
    while i*i <= n:
        if n % i == 0:
            cnt += 1
            if i != n // i:
                cnt += 1
        i += 1
    return cnt

numbers = [1,10, 100, 1000, 10000, 100000, 1000000]
datas = [0,23,473,7053,93643,1166714,13969985]

N = int(input())
ttl = 0
numPin = 0

for i in range(7):
    if 10 ** i <= N < 10 ** (i+1):
        numPin = i
        break

if numPin != 6:
    if N - numbers[numPin] < numbers[numPin + 1] - N:
        for i in range(numbers[numPin], N):
            ttl += make_divisors(i)
        print(ttl + datas[numPin])
    else:
        for i in range(N,numbers[numPin+1]):
            ttl -= make_divisors(i)
        print(ttl + datas[numPin + 1])
else:
    print(datas[numPin])

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
count=0
for i in range(1,n):
    for t in range(1,n):
        if n-i*t>0:
            count +=1
        else:
            pass
print(count)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a = 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):
    a += len(make_divisors(n-i-1))
print(a)

Submission status: Time Limit Exceeded

Solution code:
N=int(input(''))
C=0
F=N-C

a=0
k=0
v=0

while C<N-1:
  C=C+1
  while a<=F:
      a=a+1
      v=v+(F%a)
      if v==0:
          k=k+1
      v=0
      a=0
  F=N-C
print(k)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
c=1
a=0
for i in range(n):
    x=n-c
    b=len([i for i in range(1,x+1) if x % i == 0])
    a+=b
    c+=1

print(a)

Submission status: Time Limit Exceeded

Solution code:


def sieveOfEratosthenes(N, s):

    
    prime = [False] * (N+1)

   
    for i in range(2, N+1, 2):
        s[i] = 2

    
    for i in range(3, N+1, 2):
        if (prime[i] == False):

            s[i] = i

            for j in range(i, int(N / i) + 1, 2):
                if (prime[i*j] == False):
                    prime[i*j] = True

                    
                    s[i * j] = i


def generatePrimeFactors(N):

    s = [0] * (N+1)

    sieveOfEratosthenes(N, s)


    curr = s[N]

    # Power of current prime factor
    cnt = 1
    ans=1


    while (N > 1):
        N //= s[N]

        # power
        if (curr == s[N]):
            cnt += 1
            continue

        ans*=(1+cnt)

        curr = s[N]
        cnt = 1
    return ans


N = int(input())
sumi=0
for i in range(1,N):
    sumi+=generatePrimeFactors(N-i)
print(sumi)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
n1 = 0
p = 0

for i in range(1, n):
    for j in range(1, n):
        if i % j == 0:
            p = p + 1

print(p)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

ans = 0

for a in range(1,N):
    d = N//a
    if d == 1:
        ans += 1
    else:
        for b in range(1,d+1):
            c = N-a*b
            if c > 0:
                ans += 1

print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
cnt=0
for c in range(1,N):
  if (N-c)%2==0:
    for a in range(1,N-c+1):
      if a%2==0:
        for b in range(a,N-c+1):
          if a*b+c==N:
            if a!=b:
              cnt=cnt+2
            elif a==b:
              cnt=cnt+1
      if a%2==1:
        for b in range(a+1,N-c+1,2):
          if a*b+c==N:
            if a!=b:
              cnt=cnt+2
            elif a==b:
              cnt=cnt+1
  else:
    for a in range(1,N-c+1,2):
      for b in range(a,N-c+1,2):
        if a*b+c==N:
          if a!=b:
            cnt=cnt+2
          elif a==b:
            cnt=cnt+1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
#c
import sys
n = int(input())
import math

ans = 0
for i in range(1,n):
    before = n
    for j in range(1,n):
        if before <= j:
            break
        if (n-i)%j==0 :
            before = (n-i)/j
            
            if j==(n-i)/j:
                ans+=1
            else:
                ans+=2
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
K = 0
for C in range(1,N):
  K += sum(A*B==N-C for A in range(1,N) for B in range(1,N))

print(K)

Submission status: Time Limit Exceeded

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

print(ans)

Submission status: Time Limit Exceeded

Solution code:
import math

n = int(input())

def find(a):
  c = 0
  if a % 2 == 0:
    for i in range(1, int(math.sqrt(a))+1):
      if a % i == 0:
        c += 2
  else:
    for i in range(1, int((int(math.sqrt(a))+1)/2)+1):
      if a % (i*2-1) == 0:
        c += 2
  if math.sqrt(a).is_integer():
    c -= 1
  return c

count = 0
for i in range(1, n):
  count += find(i)

print(count)

Submission status: Time Limit Exceeded

Solution code:

N = int(input())
ans = 0

for i in range(1,N):
    for j in range(1,N):
        if i*j<N:
            for k in range(1,N):
                if (i*j+k)==N:
                    ans+=1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
import math

def make_prime_list_2(num):
    if num < 2:
        return []

    # 0のものは素数じゃないとする
    prime_list = [i for i in range(num + 1)]
    prime_list[1] = 0 # 1は素数ではない
    num_sqrt = math.sqrt(num)

    for prime in prime_list:
        if prime == 0:
            continue
        if prime > num_sqrt:
            break

        for non_prime in range(2 * prime, num, prime):
            prime_list[non_prime] = 0

    return [prime for prime in prime_list if prime != 0]
    
def search_divisor_num_1(num):
    if num < 0:
        return None
    elif num == 1:
        return 1
    else:
        num_sqrt = math.floor(math.sqrt(num))
        prime_list = make_prime_list_2(num_sqrt)

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

        if num != 1:
            divisor_num *= 2

        return divisor_num

n = int(input())
cnt = 0
for i in range(1, n):
    k = n-i
    cnt += search_divisor_num_1(k)
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
x=0
for n in range(1,N):
  a=N-n
  for s in range(1,a+1):
    if a % s == 0:
      x+=1
    else:
      x+=0
print(x)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

def divisor(n):
    y = []
    v = 1
    while v <= n:
        if n % v == 0:
            y.append(v)
            v += 1
        else:
            v += 1
    return len(y)


def o(z):
    q = 0
    for i in range(1,z):
        M = z - i
        q += divisor(M)

    return q

print(o(N))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

count = 0
ABC = [0]*3

for a in range(1,N+1):
  for b in range(1,N+1):
    D = b*a
    if D >= N:
      break
    else:
#      print(a, b, N-D)
      count = count + 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
import math

nu=int(input())
total=0
for p in range(1,nu):
    for j in range(1,math.floor(math.sqrt(p))+1):
        if j**2==p:
            total+=1
        elif p%j==0:
            total+=2
print(total)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
c = 1
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]

while(N>c):
    ans += len(make_divisors(N-c))
    c += 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(1,N):
        for k in range(1,N):
            if (i*j+k==N):
                a+=1
print(a)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

ans = 0
k = N
for A in range(1, N):
    for B in range(1, N):
        if A * B < N:  # 大きさ比較なので計算早いか？
            ans += 1
        else:
            continue  # 値大きくなったらもう次のAに

print(ans)

Submission status: Time Limit Exceeded

Solution code:
num = int(input())
n = num
ans = 0

for c in range(1,n+1):
    n -= c
    for a in range(1,n+1):
        for b in range(1,n+1):
            if a * b == n:
                ans += 1
    n = num
print(ans)

Submission status: Time Limit Exceeded

Solution code:
import math
def countDivisors(n):
    cnt = 0
    for i in range(1, (int)(math.sqrt(n)) + 1):
        if (n % i == 0):
            if (n / i == i):
                cnt = cnt + 1
            else:
                cnt = cnt + 2
    return cnt
n= int(input())
x=0
for i in range(1,n):
    x+=countDivisors(n-i)
    #print(countDivisors(n-i))

print(x)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = [_ for _ in range(1, n)]
import math

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


count = 0
for c in range(1, n):
    count+=len(make_divisors(n-c))
print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

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)
	divisors.sort()
	return len(divisors)

ans = 0
for c in range(1, N):
	ab = N - c
	l = make_divisors(ab)
	ans += l
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
A = list(range(1,n+1))
B = list(range(1,n+1))
C = list(range(1,n+1))
ans =0
for i in A:
    for j in B:
        for k in C:
            if i*j+k ==n:
                ans +=1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = 0
b = 0
c = 0
while a < n:
    a+=1
    b=0
    if a == n:
        break
    while a*b-n<0:
        b+=1
        if a*b-n>=0:
            break
        c+=1
print(c)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

ans = 0

for a in range(1, n):
	b = 1
	while a * b < n:
		ans += 1
		b += 1
print(ans)