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:
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 c in range(1,n):
    ab=n-c
    buffer=make_divisors(ab)
    ans+=len(buffer)
print(ans)

Submission status: Time Limit Exceeded

Solution code:
int = int(input())
ab = []
sum = 0
for c in range(int):
    ab.append(int - c - 1)
ab.remove(0)
for i in range(len(ab)):
    for j in range(ab[i]):
        if ab[i] % (j+1) == 0:
            sum += 1
print(sum)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

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

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

ans = 0

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

print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

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([i, cnt])

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

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

    return arr

ans = 0

for i in range(1,N):
  A = factorization(N-i)
  count = 1
  for j in range(len(A)):
    count *= A[j][1]+1
  ans += count
    
print(ans-1)

Submission status: Time Limit Exceeded

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

for c in range(1, n):
    x = n - c
    for b in range(1, x+1): ans += int(x % b == 0)

print(int(ans))

Submission status: Time Limit Exceeded

Solution code:
#n, m, q = map(int, input().split())
#List = list(map(int, input().split()))
#req = [list(map(int, input().split())) for _ in range(q)]
#t = t[:-1]
#print(ans[j], end = "") 改行無しで出力
#[0]*n
#sort = sorted(a)[::-1] 降順
#if l[i] == l[j]: continue
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]

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

print(ans)

Submission status: Time Limit Exceeded

Solution code:
import collections
n=int(input())
l=[1]
for i in range(2,n):
    ll=[]
    for j in range(2,int((i**0.5)//1+2)):
        while i%j==0:
            ll.append(j)
            i/=j
    if i!=1:
        ll.append(i)
    k=collections.Counter(ll)

    num=1
    for jj in k.values():
        num*=jj+1
    l.append(num)
print(sum(l))

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 c in range(1, N-1): 
   ans += len(make_divisors(N - c))

print(ans + 1)

Submission status: Time Limit Exceeded

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

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

print(p)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
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
ans = 0
for i in range(1,N):
    n = N - i
    ans += num_divisors_trial_division(n)
print(ans)

Submission status: Time Limit Exceeded

Solution code:
def divisor(n): 
    i = 1
    count = 0
    while i * i <= n:
        if n%i == 0:
          if i * i == n:
            count += 1
          else:
            count += 2
        i += 1
    return count
    
n = int(input())

count = 0
for num in range(n):
	count += divisor(num)
print(count)

Submission status: Time Limit Exceeded

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

l = [num_divisors_trial_division(i+1) for i in range(n-1)]
Ans = sum(l)
print(Ans)

Submission status: Time Limit Exceeded

Solution code:
import math

N = int(input())
count = 0
t = 0

for c in range (1, N):
  t = N-c
  for a in range(1, int(math.sqrt(t)) +1):
    if t % a == 0:
      if t / a == a:
        count += 1
      else:
        count += 2
print(count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
from math import sqrt

N = int(input())
count = 0
for c in range(1,N):
  for a in range(1,int(sqrt(c))+1):
    if c % a == 0:
      if c == a*a:
        count += 1
      else:
        count += 2
print(count)

Submission status: Time Limit Exceeded

Solution code:
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
ans=0
N=int(input())
for i in range(1,N):
  ans=ans+num_divisors_trial_division(N-i)
print(ans)

Submission status: Time Limit Exceeded

Solution code:
p = int(input())
def Divisor(n):
  divs = []
  for i in range(1, int(n ** 0.5) + 1):
    if n % i == 0:
      divs.append(i)
      if i != n // i:
        divs.append(n // i)
  a = sorted(divs)
  return(a)
nsum = 0
for i in range(p):
  nsum += len(Divisor(i))
print(nsum)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

ct = 0
for a in range(1, N):
    for b in range(1, N):
        if a*b >= N:
            break
        ct += 1
        
print(ct)

Submission status: Time Limit Exceeded

Solution code:
# AtCoder Beginner Contest 179
# C - A x B + C

def factorization(n):
    arr = []
    temp = n
    ans=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(cnt+1)
            ans*=(cnt+1)

    if temp!=1:
        # arr.append(1+1)
        ans*=2

    # if arr==[]:
        # arr.append(1+1)
        # ans*=2
    
    # arr=np.array(arr)

    # return np.prod(arr)
    return ans

N=int(input())
ans=0
for i in range (1,N):
    ans+=factorization(N-i)

print(ans)

Submission status: Time Limit Exceeded

Solution code:
k=int(input())


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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

count = 0

for a in range(1, N):
    for b in range(1, N):
        tmp = a * b
        if tmp < N:
            count += 1

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):
        for k in range(1,n+1):
            if (i*j+k == n):
                count += 1

print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
count = 0
m = 1000000
for i in range(1,n):
  for j in range(1,n):
    for k in range(1,n):
      if (i*j)%m+k%m == n%m:
        count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
from numba import njit

@njit
def factorize1(n):
    ans=dict()
    i = 2
    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
        
    div=1
    for j in ans.items():
        div *= j[1]+1
    return div
   
N=int(input())
ans=1
for k in range(2,N):
    ans += factorize1(k)
print(ans)

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+1):
        for k in range(1, n+1):
            if (i * j) + k == n:
                cnt+=1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
import math
n=int(input())
def divisor(n): 
    i = 1
    c=0
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return len(table)
n=n-1
ans=0
while n>=1:
    ans+=divisor(n)
    n-=1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
#a * b + c = N
import math
n=int(input())

ans = 0

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

Submission status: Time Limit Exceeded

Solution code:
import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush,heapify
from math import ceil, floor, sqrt
from copy import deepcopy
 
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

def main():
    n = int(input())
    count = 0
    for i in range(n-1):
        div_lists = make_divisors(i+1)
        count += len(div_lists)
    print(count)
        

if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
D =0
A = 1
while A <= N:
    B = 1
    while B <= int(N/A):
        ans = A*B
        B += 1
        if ans > N:
            break
        C = 1
        while C <=N:
            anss =  ans + C
            C += 1
            if anss == N:
                D += 1
                break
    A += 1
print(D)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
counta=0
tmp=n

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

Submission status: Time Limit Exceeded

Solution code:
import math
import collections
import fractions
import itertools
import functools
import operator
import bisect

def divisors(n):
    cnt = 0
    i = 1
    while i*i <= n:
        if n % i == 0:
            cnt += 2
            if i == n // i:
                cnt -= 1
        i += 1
    return cnt

def solve():
    n = int(input())
    ans = 0
    for i in range(n, 1, -1):
        n -= 1
        ans += divisors(n)
    print(ans)
    return 0

if __name__ == "__main__":
    solve()

Submission status: Time Limit Exceeded

Solution code:
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())
count=0
for i in range(1,N):
  count+=num_divisors_trial_division(N-i)
print(count)

Submission status: Time Limit Exceeded

Solution code:
n = input()

count = 0
for i in range(1,int(n)):
  ans = int(n) - int(i)
  
  for j in range(1,int(n)):
    if ans%int(j) == 0:
      count += 1
  
print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

B = lambda A, C, N: (N - C) / A

count = 0
for C in range(1, N):
	for A in range(1, N-C+1):
		b = B(A, C, N)
		if b.is_integer():
			count += 1

print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())


def count_comb(a, b):
    if a == b:
        return 1
    else:
        return 2


count = 0
for A in range(1, N):
    for B in range(A, N):
        seki = A*B
        if seki > N-1:
            break
        count += count_comb(A, B)

print(count)

Submission status: Time Limit Exceeded

Solution code:
# input here
_INPUT = """\
1000
"""
"""
K = int(input())
H, W, K = map(int, input().split())
a = list(map(int, input().split()))
xy = [list(map(int, input().split())) for i in range(N)]
p = tuple(map(int,input().split()))
"""
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]

def main():
    N = int(input())

    count = 0
    for i in range(1,N):
        divisor = make_divisors(i)
        count  += len(divisor)
    print(count)
        




            
if __name__ == '__main__':
    import io
    import sys
    import math
    import itertools
    from collections import deque

    # sys.stdin = io.StringIO(_INPUT)
    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//a)+1):
        if a*b < n:
            ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
#A,B,C>0 C=N-A*B
count=(N-1)*2-1
for A in range(2,N):
    for B in range(2,N):
        if N-(A*B)<0:
            break
        elif N-(A*B)>0:
            count+=1
            # print(A,B,N-A*B)
print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

ans = 0
import math
for c in range(1, N + 1):
  a_b = N - c

  if a_b % 2 == 1:
    roop = range(1, int(math.sqrt(a_b)) + 1, 1)
  else:
    roop = range(1, int(math.sqrt(a_b)) + 1)
  for i in roop:
    if a_b % i == 0:
      ans += 2
      if int(a_b / i) == i:
        ans -= 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
a = int(input())
cnt = 1
count =0
for i in range(1,a):
    for j in range(1,a):
        c = i*j
        num = a-c
        if num >0:
          count +=1
        else:
          break
            
print(count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import math
def num_divisors(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

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())
c = 0
for i in range(1,n):
  c += num_divisors(i)
print(c)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

res=0

for i in range(1,n):
    for j in range(1,n):
        if i*j < n:
            res+=1
        else:
            break

print(res)

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]

sum=0

for c in range(1, N):
  target=N-c
  sum=sum+len(make_divisors(target))

print(sum)

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
print(x)

Submission status: Time Limit Exceeded

Solution code:
import itertools
n=int(input())
c=0
for i,j,k in itertools.product(range(1,n+1),range(1,n+1),range(1,n+1)):
    s=i*j+k
    if s==n:
        c+=1
print(c)

Submission status: Time Limit Exceeded

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

# A * B  = N - C
N = int(input())
count = 0
for i in range(1, N):
    count += count_divisors(i)

print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input(""))
d = 0
for _ in range(1,N):
  for __ in range(1,N):
    for ___ in range(1,N):
      if _*__+___ == N:
        d += 1
print(d)

Submission status: Time Limit Exceeded

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

for i in range(1,n,1):
	for j in range(1,n,1):
		if n > i*j:
			#print(i,j,n-i+j)
			ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

def get_divisors_length(n):
    ret = 0
    i = 1
    while i*i <= n:
        if n % i == 0:
            ret += 1
            if i != n // i:
                ret += 1
        i += 1
    return ret


print(sum(get_divisors_length(i) for i in range(1, N)))

Submission status: Time Limit Exceeded

Solution code:
def make_divisors(N):
    ans=dict()
    div_sum=1
    n=N
    i=2
    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())
ans = 0
for i in range(1, N):
    wa = N - i
    ans += make_divisors(wa)
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
z = 0
for a in range(N):
    for b in range(N):
        c = N - (a+1)*(b+1)
        if c > 0:
            z = z+1
        else:
            pass
print(z)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
count = 0
res = []

for i in range(1,N) :
    for j in range(1,N) :
        a = i
        b = j
        c = N-a*b
        
        if a*b>=N :
            break
        
        if a*b+c == N :
            count += 1

print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a, b, c = 1, 1, 1
ans = 0

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 divisors

for i in range(n):
     div = list(map(str, make_divisors(n-(c+i))))
     ans += len(div)

print(ans)

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:
k=int(input())


cnt=0
for i in range(1,k):
    for j in range(1,k+2):
        if i*j<k:
            cnt+=1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
import collections

n = int(input())

if n == 1:
    print(0)
else:
    lis = [i for i in range(n+1)]
    for i in range(2, int(n**0.5) + 1):
        if lis[i] == i:
            lis[i] = i
            for j in range(i**2, n+1, i):
                if lis[j] == j:
                    lis[j] = i
#print(lis)
def bunkai(m):
    ans = []
    for i in range(m):
        ans.append(lis[m])
        m = m//lis[m]
        if m == 1:
            break
    return ans

ans = 1

for i in range(2,n):
    tmp = 1
    yaku = collections.Counter(bunkai(i))
    for i in yaku:
        tmp = tmp * (yaku[i] +1)
    ans += tmp

print(ans)

Submission status: Time Limit Exceeded

Solution code:
import sys
sys.setrecursionlimit(10**7)

def input(): return sys.stdin.readline()[:-1]
mod = 10**9 + 7
def readInt():return int(input())
def readIntList():return list(map(int,input().split()))
def readStringList():return list(input())
def readStringListWithSpace():return list(input().split())
def readString():return input()

from itertools import accumulate
 
def execute():
    n = readInt()
    count = 0
    temp = []
    for i in range(1,n+1):
        for j in range(1,n+1):
            if 1 <= n - (i*j) < n:
                if [i,j,n - (i*j)] not in temp:
                    temp += [[i,j,n - (i*j)]]
            # for k in range(1,n+1):
            #     if i * j + k == n:
            #         if [i,j,k] not in temp:
            #             temp += [[i,j,k]]
    print(len(temp))


    
 
if __name__ == "__main__":
    execute()

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
def make_divisors(n):
    p = 0
    i = 1
    while i*i <= n:
        if n % i == 0:
            p+=1
            if i != n // i:
                p+=1
        i += 1
    return p
ans=0
for i in range(1,N):
    ans+=make_divisors(i)

print(ans)

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)
    c = collections.Counter(a)
    l = list(c.values())

    so = 1
    for i in l:
        so *= (i + 1)
    return so


n = int(input())

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

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
import math

N = int(input())

ans = 0
#N_half = int(math.sqrt(N)+1)
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())

def divisor(n):
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = len(list(set(table)))
    return table
a=0
for i in range(1,n):
    a+=divisor(i)
print(a)

Submission status: Time Limit Exceeded

Solution code:

def abc179c():
    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 divisors

    cnt = 0
    for i in range(1,n):
        #２乗の数じゃ無いなら　平方数なら-1で1/2
        cnt += len(make_divisors(n-i))
        #print('max:',n,'n-c:',i,'cnt:',cnt)

    print(cnt)















abc179c()

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
final_ans = 1
for h in range(2,N):
         n = h
         x = n
         ans = []
         for i in range(2,int(x**(1/2))+1):
                  if n % i == 0:
                           soinsuu = i
                           zyousuu = 0
                           while n % i == 0:
                                    n = n // i
                                    zyousuu += 1
                           ans.append([soinsuu,zyousuu])
         if n != 1:
                  ans.append([n,1])
         tmp = 1
         for j in range(len(ans)):
                  tmp *= (ans[j][1] + 1)
         final_ans += tmp
print(final_ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
count = 0
for C in range(1,N):
  for A in range(1,N-C+1):
    B = (N-C)/A
    if B.is_integer():
      count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

def fact(n):
  res = dict()
  while True:
    if n == 1:
      return res
    for i in range(2,n+1):
      if n % i == 0:
        if i in res:
          res[i]+=1
        else:
          res[i]=1
        n //= i
        break
res = 0
for i in range(1,n):
  ab = n - i
  f = fact(ab)
  tmp = 1
  for x in f.values():
    tmp *= (x+1)
  res +=tmp
print(res)

Submission status: Time Limit Exceeded

Solution code:
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 6)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")
al = "abcdefghijklmnopqrstuvwxyz"
AL = al.upper()

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 divisors

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

n = k()

for i in range(1,n):
  a = len(make_divisors(i))
  if a % 2 != 0:
    ans += 2*(a//2) + 1
  else:
    ans += 2*(a//2)

print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
# a*b + c == nを満たす(a,b,c)の組はいくつあるか
l = list(range(1, n, 1))
count = []
kake = 0

for a in l:
    for b in l:
        kake = a*b
        if kake >= n:
            break
        else:
            count.append([a, b])

print(len(count))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

count = 0
for i in range(n - 1):
    c = i + 1
    a_b = n - c
    a = 1
    while a <= a_b:
        if a_b % a == 0:
            count += 1
        a += 1

print(count)

Submission status: Time Limit Exceeded

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

for a in range(N):
    if a == 0:
        continue
    for b in range(N):
        if b == 0:
            continue

        c = N - a*b
        if isinstance(c, int) and c > 0:
            ans += 1

print(ans)

Submission status: Time Limit Exceeded

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

print(count)

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
count = 0
for A in range(1,N):
  for B in range(1,N):
    if A*B >= N:
      break
    else:
      count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
import math

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):
  com = len(divisor(i))
  s += com
print(s)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

print(ans)