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:
num = int(input())
ans = 0
for x in range(num):
    for y in range(x,num):
        val = (x+1) * (y+1)
        if val < num and x == y: ans += 1
        elif val < num and x != y: ans += 2
        else: break
print(ans)

Submission status: Time Limit Exceeded

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

N = int(input())
sumdiv = 0
for i in range(1,N):
  sumdiv += make_divisors_sum(i)
print(sumdiv)

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 i * j >= N:
            break
#         print(1, j)
        ans += 1
print(ans)

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-i+1):
        if (N-i)%j==0:
            ans+=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-1:
      count += 1
    else:
      break
print(count)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = 1
b = 1
c = 1
cnt = 0
while n > a:
    while a * b < n:
        cnt += 1
        b += 1
    b = 1
    a += 1

print(cnt)

Submission status: Time Limit Exceeded

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

def mp(): return map(int, input().split())
def lmp(): return list(map(int, input().split()))


n = int(input())
cnt = 0
for c in range(1, n):
    tar = n-c
    for a in range(1, int(tar**0.5)+1):
        if tar % a == 0:
            b = tar // a
            if b > 0 and a != b:
                cnt += 2
            elif b > 0:
                cnt += 1

print(cnt)

Submission status: Time Limit Exceeded

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

for i in range(1,N+1):
  AB = N -i
  for j in range(1,AB+1):
    if AB % j == 0:
      count += 1
    else:
      continue
print(count)

Submission status: Time Limit Exceeded

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


def solve(N: int):
    n = 0
    for c in range(1, N):
        a = 1
        # print("c",c)
        while a*a < N-c:
            # print("a",a)
            if (N-c) % a == 0:
                n += 2
            a += 1
        if a*a == N-c:
            n += 1
    print(n)
    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

for a in range(1,10**6):
  if n - a < 0:
    break
  for b in range(a,10**6):
      if n - a*b > 0:
        if a == b:
        	count += 1
        else:
          count += 2
      if n -a*b < 0:
        break

print(count)

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=3))

cnt=0

for j in b:
  if j[0]*j[1]+j[2]==H:
    cnt+=1
    
print(cnt)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
from sys import stdin
readline = stdin.readline
def i_input(): return int(readline().rstrip())
def i_map(): return map(int, readline().rstrip().split())
def i_list(): return list(i_map())

def make_divisors(n):
    result = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            result.append(i)
            if i != n // i:
                result.append(n//i)
    result.sort()
    return result

def main():
    N = i_input()
    ans = 0
    for c in range(1, N):
        ab = make_divisors(N - c)
        ans += len(ab)
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

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

def mal(m):
    global count
    for a in range(1,m+1):
        b = m/a
        if(b.is_integer()):
            count+=1

for c in range(1,n):
    mal(n-c)

print(count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
# a*b + c=n (a,b,c) いくつ？
cnt = 0
for a in range(1, n+1):
    bn = (n) // a
    for b in range(1, bn+1):
        c = n-(a*b)
        if c<=0: break
        if a*b + c == n:
            cnt += 1


print(cnt)

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]

# print(len(make_divisors(n)))
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())
count=0
for k in range(1,N):
    for a in range (1,N):
        if k%a==0:
            count=count+1
        else:
            continue
print(count)

Submission status: Time Limit Exceeded

Solution code:
import sys
def input():
    return sys.stdin.readline()[:-1]


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 len(table)


def main():
    n = int(input())
    ans = 0
    for i in range(1,n):
        x = n - i
        ans += divisor(x)
    print(ans)

    
if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

Solution code:
def main():
    N = int(input())
    count = 0
    for i in range(1, N):
        M = N // i + 1
        for j in range(1, M):
            k = N - i*j
            if k > 0 and N == i*j + k:
                count += 1

    print(count)


if __name__ == '__main__':
    main()

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())
cnt=0
for i in range(1,N):
    cnt += len(make_divisors(N-i))
    
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())

def make_div(n):
    div = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            div.append(i)
            if i != n // i:# 平方数の時を考慮
                div.append(n//i)

    div.sort()
    return div

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

Submission status: Time Limit Exceeded

Solution code:
num = 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 i in range(num):
  sets = len(make_divisors(i))
  cnt+=sets

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
num = int(input())
ans = 0
for x in range(num):
    for y in range(num):
        val = (x+1) * (y+1)
        if val < num: ans += 1
        else: break
print(ans)

Submission status: Time Limit Exceeded

Solution code:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy
import bisect

mod = 10**9 + 7

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

if __name__ == "__main__":
    n = int(input())
    ans = 0

    for c in range(1,n):
        d = n - c
        k = make_divisors(d)
        ans += len(k)
    print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

count = 0

for i in range(N - 1):
    A = i + 1
    for j in range(N-1):
        B = j + 1

        if A * B < N:
            count += 1
        else:
            break

print(count)

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(i)))
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ans = 0
a = 1
repeat_count = 0
while a <= n:
    b = 1
    while b <= a and a*b < n:
        ans += 1
        if b < a:
            repeat_count += 1
        b += 1
    a += 1
print(ans + repeat_count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

        
if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
l = int(input())
sum = 0
c = 0

for i in range(1,l):
  for ii in range(1,l):
    sum = i * ii
    if sum >= l:
      break
    else:
      c+=1

print(c)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())


def divisor(n):
    count = 0
    i = 1
    while i * i <= n:
        ans, mod = divmod(n, i)
        if mod == 0:
            if ans == i:
                count += 1
            else:
                count += 2
        i += 1
    return count

total_pair = 0

for c in range(1, N):
    y = N - c
    total_pair += divisor(y)

print(total_pair)

Submission status: Time Limit Exceeded

Solution code:
from math import sqrt


def cnt_divisors(n):
    cnt = 0
    for i in range(1, (int)(sqrt(n)) + 1):
        if n % i == 0:
            if n // i == i:
                cnt = cnt + 1
            else:
                cnt = cnt + 2
    return cnt


N = int(input())
ans = 0
for C in range(1, N):
    ans += cnt_divisors(N - C)
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())
cnt=0
for a in range(1,N):
    for b in range(1,N):
        for c in range(1,N):
            if(a*b+c==N):
                cnt+=1    
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

def fctr1(n):
    c = 0
    r = int(n**0.5)
    res = 1
    for i in range(2, r+2):
        while n % i == 0:
            c += 1
            n = n//i
        if c != 0:
            res *= (c+1)
            c = 0
    if n != 1:
        res *= 2
    return res

ans = 0
for i in range(1, n):
    ab = i
    ans += fctr1(i)
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())
res = 0
for i in range(1,n):
  ab = n - i
  tmp = 0
  for j in range(1,ab+1):
    if ab % j == 0:
      res += 1
print(res)

Submission status: Time Limit Exceeded

Solution code:
import sys
## io ##
def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))
#======================================================#
def main():
    n = II()
    cnt = 0
    for c in range(1, n):
        ab = n-c
        if ab <= 0:
            continue
        if (ab**0.5).is_integer():
            cnt -= 1
        for i in range(1,int(ab**0.5)+1):
            if ab%i == 0:
                cnt += 2
    print(cnt)

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
count = 0
for a in range(1,1000001):
	for b in range(1,1000001):
		if a*b<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):
  for j in range(1,N-i+1):
    if (N-i)%j==0:
      count+=1
print(count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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):
        B = (N - C) / A
        if B > 0 and B.is_integer():
            ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:

N = int(input())
cnt = 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 c in range(1,N):
    k = len(make_divisors(N - c))
    cnt += k
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

# 約数の個数
def divisible_count(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

res = 0
for i in range(1, n):
    num = n - i
    res += divisible_count(num)

print(res)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import math
n = int(input())
res=0
for i in range(1,n):

    cnt=0
    for j in range(1,int(math.sqrt(i))+1):
        if i%j==0:
            cnt+=2
    if math.sqrt(i)==int(math.sqrt(i)):
        cnt-=1
    res+=cnt
print(res)

Submission status: Time Limit Exceeded

Solution code:
import math
def main():

    N = int(input())
    cnt = dict()
    for i in range(1, N+1):
        for j in range(1, N+1):
            if i * j < N:
                cnt[i*j] = cnt.get(i*j, 0) + 1
            else:
                break
    ans = 0
    for i in range(1, N):
        if N-i in cnt:
            ans += cnt[N-i]
    return ans


if __name__ == '__main__':
    print(main())

Submission status: Time Limit Exceeded

Solution code:
# http://www.nct9.ne.jp/m_hiroi/puzzle/prime.html
def factorization(n):
    def factor_sub(n, m):
        c = 0
        while n % m == 0:
            c += 1
            n /= m
        return c, n
    #
    buff = []
    c, m = factor_sub(n, 2)
    if c > 0: buff.append((2, c))
    c, m = factor_sub(m, 3)
    if c > 0: buff.append((3, c))
    x = 5
    while m >= x * x:
        c, m = factor_sub(m, x)
        if c > 0: buff.append((x, c))
        if x % 6 == 5:
            x += 2
        else:
            x += 4
    if m > 1: buff.append((m, 1))
    return buff

# http://www.nct9.ne.jp/m_hiroi/puzzle/divisor.html#ans03
def divisor_num(n):
    a = 1
    for _, x in factorization(n):
        a *= x + 1
    return a

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

print(ans)

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 N - i * j >= 1:
      cnt += 1

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())
cnt = 0
for i in range(1,n):
  d = make_divisors(n-i)
  cnt += len(d)
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:
def numdiv(n):
    num=0
    for i in range(1,int(n**0.5)+1):
        if n%i==0:
            num+=1
            if n//i != i:
                num+=1
    return num
n = int(input())
ans = 0
for i in range(1,n):
    ans += numdiv(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):
    temp = len(make_divisors(N-i))
    #print(make_divisors(N-i), temp)
    ans += temp
print(ans)

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]
total = 0
for i in range(1,n):
  f = n-i
  total += len(make_divisors(f))

print(total)

Submission status: Time Limit Exceeded

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

for a in range(1,10**6):
  for b in range(1,10**6):
      if n - a*b > 0:
        count += 1
      if n -a*b < 0:
        break

print(count)

Submission status: Time Limit Exceeded

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

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 a * b + c == N and c > 0:
            ans += 1
            # print(a,b,c)
        elif a * b > N:
            break

print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
count = 0
for c in range(1, N+1):
    NC = N - c
    for b in range(1, NC+1):
        if NC % b == 0:
            count = count + 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 - 1) // i + 1):
    if i * j <= n - 1:
      ans += 1
    
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
def factor_finder(x):
    fac=0
    for i in range(1,int(x**0.5)+1):
        if x%i==0:
            fac+=2
    if int(x**0.5)==x**0.5:
        fac-=1
    return fac
total=0
for i in range(1,n):
    total+=factor_finder(n-i)
print(total)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

MAXNUM = 10 ** 6 + 10
a = [i for i in range(1, MAXNUM)]

def calc(i):
    l, r = 0, MAXNUM
    while r-l > 1:
        mid = (l+r)//2
        if mid * i < N:
            l = mid
        else:
            r = mid
    return l

cnt = 0
for i in range(1, MAXNUM):
    cnt += calc(i)

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = 1
B = 1
p = 0

while A < N:
  while A * B < N:
    p += 1
    B += 1
  A += 1
  B = 1

print(p)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
cnt=0
for i in range(n):
    for j in range(n):
        if i*j>=n:
            break
        for k in range(n):
            if i*j+k>n:
                break
            if i*j+k==n:
                cnt+=1
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,int(N/A)+1+1):
    if N - A * B >= 1:
      count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

# 約数列挙O(√N)


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


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

Submission status: Time Limit Exceeded

Solution code:
import math
import sys
import os

sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r")
INF = float("inf")

def divisor_count(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    

N = I()
ans = 0

for i in range(1,N):
    ans += divisor_count(i)

print(ans)

Submission status: Time Limit Exceeded

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

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

for i in range(1,n):
  counted +=  make_divisors(i)

print(counted)

Submission status: Time Limit Exceeded

Solution code:
def main():
    N = int(input())
    ans = 0
    for c in range(1, N):
        ans += solve(N-c)
    print(ans)

def solve(n):
    res = 0
    for i in range(1,n+1):
        if n % i == 0:
            res += 1
    return res

main()

Submission status: Time Limit Exceeded

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

A = 1
count = 0
while A < N:
	B = 1
	while A * B < N:
		B += 1
		count += 1
	A += 1
print(count)

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>0:
            cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from math import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
import math
import bisect
import heapq
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入g
#
# インデックス系
# int min_y = max(0, i - 2), max_y = min(h - 1, i + 2);
# int min_x = max(0, j - 2), max_x = min(w - 1, j + 2);
#
#
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
#mod = 998244353
INF = float('inf')
from sys import stdin
readline = stdin.readline
def readInts():
  return list(map(int,readline().split()))
def readTuples():
    return tuple(map(int,readline().split()))
def I():
    return int(readline())

n = I()
ab = set()
for c in range(1,n):
    nc = n-c
    ab.add(nc)
ans = 0
for v in ab:
    if v == 1:
        ans += 1
        continue
    #print(v)
    i = 1
    while i*i <= v:
        # print('?')
        if v%i == 0:
            #print('?')
            div = v//i
            if i == div:
                ans += 1
            else:
                ans += 2
        i += 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

def main():
    N = int(input())
    ans = 0
    for c in range(1, N):
        ans += len(make_divisors(N - c))
    return ans

if __name__ == '__main__':
    print(main())

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):
    k = n - c
    l = len(make_divisors(k))
    ans += l

print(ans)

Submission status: Time Limit Exceeded

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

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:
            break
        else:
            count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
n=input() 
ans=0 
from math import sqrt
for i in range(1,n): 
    p=n-i 
    s=0 
    for j in range(1,int(sqrt(p))+1): 
        if p%j==0: 
            if j==(p/j): 
                ans-=1 
            ans+=2 
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 // A + 1):
    if A * B < N:
      cnt += 1
      
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/python3
#coding: utf-8

N = int(input())

ret = 0
for A in range(1, N):
    for B in range(1, N):
        if A * B >= N:
            break
        ret += 1
print(ret)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
ans = 0
for i in range(1, N):
    temp = N-i
    j = 1
    low = []
    up = []
    while j**2<=temp:
        if temp%j==0:
            low.append(j)
            if j!=temp//j:
                up.append(temp//j)
        j+=1
    ans+=len(low+up[::-1])
print(ans)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
import math

''' Count all divisors of a number '''
def count_all_divisors_of_a_number(x):
    cnt = 0
    for i in range(1, int(math.sqrt(x)) + 1):
        if x % i == 0:
            cnt += 1
            if i * i != x:
                cnt += 1
    return cnt

n = int(input())

result = 0
for i in range(n):
    result += count_all_divisors_of_a_number(i)
print(result)

Submission status: Time Limit Exceeded

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

#bit全部作ってる
#bit = [i>>j&1 for j in range(n)]

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import sys, math
from collections import defaultdict, deque, Counter
from bisect import bisect_left, bisect_right
from itertools import combinations, permutations, product
from heapq import heappush, heappop
from functools import lru_cache
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mat = lambda x, y, v: [[v]*y for _ in range(x)]
ten = lambda x, y, z, v: [mat(y, z, v) for _ in range(x)]
mod = 1000000007
sys.setrecursionlimit(1000000)

N = ri()

def get_num(c):
	t = N-c
	a = 1
	num = 0
	while a*a <= t:
		if t % a == 0:
			b = t // a
			if a == b:
				num += 1
			else:
				num += 2
		a += 1
	return num

ans = 0
for c in range(1, N):
	ans += get_num(c)
print(ans)

Submission status: Time Limit Exceeded

Solution code:
import sys
readline = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
#mod = 998244353
INF = 10**18
eps = 10**-7

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


print(cnt)

Submission status: Time Limit Exceeded

Solution code:

N = int(input())

ans = 0

for a in range(1, N+1):
    for b in range(1, int(N/a)+1):
        if a * b < N:
            ans +=1
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
    else:
      break
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:
            break
        ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

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

print(ans)