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: Wrong Answer

Solution code:
from operator import mul
from functools import reduce

def main():
    def factorization(n):
        l = []
        tmp = n
        for i in range(2, int(-(-tmp**0.5//1))+1):
            if tmp%i == 0:
                cnt = 0
                while tmp%i == 0:
                    cnt += 1
                    tmp //= i
                l.append(cnt+1)
                i += 1
        if tmp != 1:
            l.append(2)
        if l == []:
            if n != 1:
                l.append(2)
        if n == 1:
            l = [2]
        return l

    n = int(input())
    cnt = 0
    i = n
    for i in range(1, n):
        div = factorization(n-i)
        pattern = reduce(mul, div)
        cnt += pattern
    print(cnt) 
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

for a in range(1, N+1):
  tmp = (N-1) // a
  if a == (N-1) // 2:
    count += 1
  elif a < (N-1) // 2:
    count += tmp
  else:
    count += 1          

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
NR = int(N**0.5)
count = 0
for i in range(1,int(N/2)+1):
    if int(N/i)-N/i == 0:
        count += int(N/i)-1
    else:
        count += int(N/i)

count += int(N/2)
print(count)

Submission status: Wrong Answer

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

for a in range(1, N+1):
  tmp = (N-1) // a
  if a == tmp:
    count += 1
  if a < N // 2:
    count += tmp
  else:
    count += 1          

print(count-1)

Submission status: Wrong Answer

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

def prime(x):
    cbn, ct = 0, 0
    l2 = int(math.sqrt(x))
    for i in range(1, l2+1):
        if x % i == 0:
            ab.append([i, int(x/i)])
            ct += 2
            if ab[-1][0] == ab[-1][1]:
                ct -= 1
        cbn += ct
        ct = 0
    return cbn

for c in range(1, n):
    print(c)
    ans += prime(n-c)
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
NR = int(N**0.5)
count = 0
for i in range(1,int(N/2)):
    if int(N/i)-N/i == 0:
        count += int(N/i)-1
    else:
        count += int(N/i)

count += int(N/2)
print(count)

Submission status: Wrong Answer

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

r=0
t=n//2
for i in range(1,t+1):
    p=((n-1)//i)



    s+=p

print(s+t-1)

Submission status: Wrong Answer

Solution code:
import collections

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

N = int(input())

total = 0

for i in range(1,N):
    flag = False
    ab = N-i
    for i in range(1,10**3):
        if ab == i**2:
            flag = True
            break;

    c = collections.Counter(prime_factorize(ab))
    #print(prime_factorize(1)==[])
    #print(list(c)==[])

    val = 1
    if list(c)==[]:
        val = 2
    for itm in c.values():
        #print(itm)
        val *= itm+1
    
    total +=val

    if flag == True:
        total +=-1
    
    #print(total)



print(total)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

cnt = 3
if N > 3:
    for i in range(1,N-1):
        A = N-i
        rA = math.sqrt(A)
        intA = math.floor(rA)
        if rA == intA:
            cnt -= 1
        if intA == 1:
            cnt += 1
        else:
            for j in range(1,intA+1):
                if A%j == 0:
                    cnt += 2

print(cnt)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
cnt = 0
root = math.sqrt(N)

if float.is_integer(root):
    finish = int(root-1)
else:
    finish = int(root)
root = int(root)
if root<2:
    z = root+1
else:
    z = root
for a in range(1,z):
    # print(a, (N-1)//a - a)
    cnt += (N-1)//a - a
if root<2:
    print(cnt*2+finish)
else:
    print(cnt*2+finish)

Submission status: Wrong Answer

Solution code:
import numpy as np
N=int(input())
div = np.zeros(N+1, np.int64)
for n in range(1, N+1):
    for m in range(n, N+1, n):
        div[m] += 1
print(sum(div))

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
ans = 1 + (N-2)*2
for ab in range(2,N):
  t=math.sqrt(ab)
  if t.is_integer():
    ans += 1
    continue
  for a in range(2, int(ab**.5)):
    if ab % a == 0: ans += 2
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
for i in range(1,N-1):
    x = (N-1)//i
    ans += x
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

count = 0

for a in range(1, N + 1):
  for b in range(1, N + 1):
    c = N - a * b
    
    if c >= 0:
      count += 1
    
print(count)

Submission status: Wrong Answer

Solution code:
import collections

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

N = int(input())

total = 0

for i in range(1,N):
    flag = False
    ab = N-i
    for i in range(1,10**3):
        if ab == i**2:
            flag = True
            break;

    c = collections.Counter(prime_factorize(ab))
    #print(prime_factorize(1)==[])

    val = 1
    if c.values() == []:
        val = 2
    for itm in c.values():
        #print(itm)
        val *= itm+1
    
    total +=val

    if flag == True:
        total +=-1
    
    #print(total)



print(total)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
ans = 1 + (N-2)*2
for ab in range(2,N):
  t=math.sqrt(ab)
  if t.is_integer():
    ans += 1
    continue
  l = [ a for a in range(2, int(t)) if ab % a == 0 ]
  ans += 2*len(l)
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
m = 2
z = 0

for i in range(n-2):
    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([m, 1])

        return arr

    x = 0
    y = 1

    r = factorization(m)
    l = len(r)

    for i in range(l):
        y = y * (r[x][1]+1)
        x+=1

    print(y)

    m+=1
    z = z + y

print(z+1)

Submission status: Wrong Answer

Solution code:
N = int(input())

count = 0

for a in range(N + 1):
  for b in range(N + 1):
    c = N - a * b
    
    if c >= 0:
      count += 1
    
print(count)

Submission status: Wrong Answer

Solution code:
import os,sys

count=0
n=int(input())

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

Submission status: Wrong Answer

Solution code:
def main():
    n_num = int(input())
    # n_num = 1013
    prime = '2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857 859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997 1009 1013 1019 1021 1031 1033 1039 1049 1051 1061 1063 1069 1087 1091 1093 1097 1103 1109 1117 1123 1129 1151 1153 1163 1171 1181 1187 1193 1201 1213 1217 1223 1229 1231 1237 1249 1259 1277 1279 1283 1289 1291 1297 1301 1303 1307 1319 1321 1327 1361 1367 1373 1381 1399 1409 1423 1427 1429 1433 1439 1447 1451 1453 1459 1471 1481 1483 1487 1489 1493 1499 1511 1523 1531 1543 1549 1553 1559 1567 1571 1579 1583 1597 1601 1607 1609 1613 1619 1621 1627 1637 1657 1663 1667 1669 1693 1697 1699 1709 1721 1723 1733 1741 1747 1753 1759 1777 1783 1787 1789 1801 1811 1823 1831 1847 1861 1867 1871 1873 1877 1879 1889 1901 1907 1913 1931 1933 1949 1951 1973 1979 1987 1993 1997 1999 2003 2011 2017 2027 2029 2039 2053 2063 2069 2081 2083 2087 2089 2099 2111 2113 2129 2131 2137 2141 2143 2153 2161 2179 2203 2207 2213 2221 2237 2239 2243 2251 2267 2269 2273 2281 2287 2293 2297 2309 2311 2333 2339 2341 2347 2351 2357 2371 2377 2381 2383 2389 2393 2399 2411 2417 2423 2437 2441 2447 2459 2467 2473 2477 2503 2521 2531 2539 2543 2549 2551 2557 2579 2591 2593 2609 2617 2621 2633 2647 2657 2659 2663 2671 2677 2683 2687 2689 2693 2699 2707 2711 2713 2719 2729 2731 2741 2749 2753 2767 2777 2789 2791 2797 2801 2803 2819 2833 2837 2843 2851 2857 2861 2879 2887 2897 2903 2909 2917 2927 2939 2953 2957 2963 2969 2971 2999 3001 3011 3019 3023 3037 3041 3049 3061 3067 3079 3083 3089 3109'
    prime = [int(i) for i in prime.split()]
    le = len(prime)
    def fract(n):
        k = 0
        lis = []
        while True:
            if n == 1:
                break
            cnt = 0
            li = []
            while n % prime[k] == 0:
                cnt += 1
                n = int(n/prime[k])
                # li.append(prime[k])
            else:
                if cnt >= 1:
                    li = [prime[k], cnt]
                    lis.append(li)
                k += 1
                if k >= le:

                    return [[n, 1]]

        return lis

    def frac_sum(n):
        if n == 1:
            return 1
        cn = 1
        for f in fract(n):
            cn *= f[1] + 1
        return cn


    # print(fract(100))
    # print(prime)
    ans = 0
    for p in range(1, n_num):
        ans += frac_sum(p)

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import collections

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

N = int(input())

total = 0

for i in range(1,N):
    flag = False
    ab = N-i
    for i in range(1,10**3):
        if ab == i**2:
            flag = True
            break;

    c = collections.Counter(prime_factorize(ab))
    #print(prime_factorize(1))

    val = 1
    if c.values() == None:
        val = 2
    for itm in c.values():
        #print(itm)
        val *= itm+1
    
    total +=val

    if flag == True:
        total +=-1
    
    #print(total)



print(total)

Submission status: Wrong Answer

Solution code:
N = int(input())

count = 0

for a in range(N + 1):
  for b in range(N + 1):
    c = N - a - b
    
    if c >= 0:
      count += 1
    
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

ans = ans + (n-1)


print(ans)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
ans = 1 + (N-2)*2
for ab in range(2,N):
  t=math.sqrt(ab)
  if t.is_integer():
#  if (t:=math.sqrt(ab)).is_integer():
    ans += 1
    continue
  l = [ 2 for a in range(2, int(t)) if ab % a == 0]
  ans += sum(l)
print(ans)

Submission status: Wrong Answer

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, 200000, 250000,300000,350000, 400000,450000, 500000,600000,750000,800000,850000,900000,950000,1000000]
datas = [0,23,473,7053,93643,1166714, 2472071, 3145923, 3829761, 4522005,5221424,5927120,6638407,8075420,10261678,10997400,11736253,12478098,13222660,13969985]

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

for i in range(len(numbers)):
    if N == 1000000:
        break
    if numbers[i] <= N < numbers[i+1]:
        numPin = i
        break

if numPin != len(numbers)-1:
    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: Wrong Answer

Solution code:
n = int(input())
l = [0]*n
c = 0
for i in range(1, n):
    l[i-1] += n//i
    if (i ** .5).is_integer():
        c += 1
print(sum(l)-c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
valmax = int(input()) 

cnt = 0
for A in range(1,int(valmax/2)):
    for B in range(1,valmax):
        if A*B >= valmax:
            break
        cnt += 1
print(cnt+int(valmax/2))

Submission status: Wrong Answer

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

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

import math

def isPrime(n):
    if n == 2:
        return True
    if n % 2 == 0:
        return False
  
  # nの平方根まで計算する
    m = math.floor(math.sqrt(n)) + 1
    for p in range(3, m, 2):
        if n % p == 0:
            return False
    return True

C = 1
Cnt = 0
cnt = 1
while N - C > 0:
    cnt = 1
    if isPrime(N-C):
        Cnt += 2
    else:
        x = collections.Counter(prime_factorize(N-C))
        X = list(x.values())
        for i in X:
            cnt *= (i+1)
        Cnt += cnt
    C += 1
    
print(Cnt)

Submission status: Wrong Answer

Solution code:
import os,sys

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

Submission status: Wrong Answer

Solution code:
import collections

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

N = int(input())

total = 0

for i in range(1,N):
    flag = False
    ab = N-i
    for i in range(1,10**3):
        if ab == i**2:
            flag = True
            break;

    c = collections.Counter(prime_factorize(ab))
    #print(c)

    val = 1
    for itm in c.values():
        #print(itm)
        val *= itm+1
    
    total +=val

    if flag == True:
        total +=-1
    
    #print(total)



print(total)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
cnt = 0
root = int(math.sqrt(N))
if root<2:
    z = root+1
else:
    z = root
for a in range(1,z):
    # print(a, (N-1)//a - (a-1))
    cnt += (N-1)//a - (a-1)
if root<2:
    print(cnt*2-root)
else:
    print(cnt*2-(root-1))

Submission status: Wrong Answer

Solution code:
import math

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

print(ans)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
X = math.floor(N**0.5)

count =0
for A in range(1,X):
    for B in range(A,N):
        if A==B:
            count =count+1
        elif A*B<=(N-1):
            count=count+2
        else:
            pass

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

N = int(input())
S = [0 for i in range(N - 1)]
for i in range(1, N):
    if(i == 1):
        S[i-1] = 1
    else:
        div_count = make_divisors(i)
        
        S[i-1] = S[i-2] + div_count

Submission status: Wrong Answer

Solution code:
def prime_factorize(n):
    a = 0
    while n % 2 == 0:
        a += 1
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a += 1
            n //= f
        else:
            f += 2
    if n != 1:
        a += 1
    return a

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

Submission status: Wrong Answer

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

print(count-daburi)

Submission status: Wrong Answer

Solution code:
n = int(input())

result = 0

for i in range(n):
  for j in range(n):
    for k in range(n):
      if n == i * j + k:
        result += 1

print(result)

Submission status: Wrong Answer

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

for i in range(1, n):
    c = i
    can = []
    for j in range(1, (n - c)):
        if ((n - c) / j).is_integer():
            if ((n - c) / j) * j + c == n and [((n - c) / j), j, c] not in can:
                can.append([((n - c) / j), j, c])
                cnt += 1
            if ((n - c) / j) * c + j == n and [c, ((n - c) / j), j] not in can:
                can.append([c, ((n - c) / j), j])
                cnt += 1
            if j * c + ((n - c) / j) == n and [j, c, ((n - c) / j)] not in can:
                can.append([j, c, ((n - c) / j)])
                cnt += 1
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
if N == 2:
    print(0)
    import sys
    sys.exit()
if N == 3:
    print(3)
    import sys
    sys.exit()


s = 0
m = N//2 if N%2 == 0 else N//2 + 1
for n in range(1, m):
    s += (N//n if N%n != 0 else N//n - 1)

print(s+N//2)

Submission status: Wrong Answer

Solution code:
import math
def comb(A,B) :
  return math.factorial(A) // (math.factorial(A - B) * math.factorial(B))
base = comb(31,2)
print(base+8)

Submission status: Wrong Answer

Solution code:
n = int(input())

result = 0

for i in range(n):
  for j in range(n):
    for k in range(n):
      result += 1

print(result)

Submission status: Wrong Answer

Solution code:
max = int(input()) - 1

cnt = 0
for A in range(max):
    for B in range(max):
        if A*B > max:
            break
        cnt += 1

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
ans = 0
for i in range(n):
   ans += n//(i+1)
print(ans-int(math.sqrt(n-1)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

print(count)

Submission status: Wrong Answer

Solution code:
import math
# s = 12
# k = int(math.sqrt(s))+1
# print(k)
n = int(input())
cnt = 0
for c in range(1, n-1):
	s = n - c
	k = int(math.sqrt(s+1))
	for a in range(1, s):
		if(a*a > s):
			break
		# b = s//a 
		# if(isinstance(b, int)):
		if(s%a == 0):
			b = s//a
			if(a == b):
				cnt += 1
			else:
				cnt += 2
			print('a s', a, s)
print(cnt+1)

Submission status: Wrong Answer

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:
            print(j)
            break
        if (n-i)%j==0 :
            
            
            if j==(n-i)/j:
                ans+=1
            else:
                ans+=2
        before = (n-i)/j
print(ans)

Submission status: Wrong Answer

Solution code:
import math
counter = 0
num = int(input())
count = 1 + (num - 2) * 2

for i in range(2, (num // 2)):
    for j in range(2, (num // 2)):
        if i * j < num:
            counter += 1

print(count + counter)

Submission status: Wrong Answer

Solution code:
n = int(input())
count=0
daburi=0
for i in range(1,n):
    if i == (n-1)//i:
        daburi+=1
    else:
        count+=(n-1)//i

print(count+daburi)

Submission status: Wrong Answer

Solution code:
import numpy as np
N=int(input())
div = np.zeros(N+1, np.int64)
for n in range(1, N+1):
  for m in range(n, N+1, n):
    div[m] += 1
print(sum(div))

Submission status: Wrong Answer

Solution code:
N = int(input())
s = [0,1]
for i in range(2,N):
    for j in range(2,int(i**0.5 + 1)+1):
        if i % j == 0:
            k = i//j
            s.append(2*s[k])
            break
    if len(s) != i+1:
        s.append(1)
print(sum(s))

Submission status: Wrong Answer

Solution code:
n = int(input())
s=(n-1)
#ab = n//2 if n%2==0 else n//2 + 1
for x in range(2,n//2):
    if n%x==0:
        s+=(n//x - 1)
    else:
        s+=(n//x)
print(s + n//2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
ab = []

def prime(x):
    for i in range(1, x+1):
        if x % i == 0:
            ab.append([i, int(x/i)])

for c in range(1, n):
    print(c)
    prime(n-c)

print(len(ab))

Submission status: Wrong Answer

Solution code:


n = int(input())
ans = 0

for i in range(2,n,1):
    for j in range(i,n):
        if n % i*j != 0:
            #print(n,i,j,i*j)
            ans += 1

ans = ans + (n-1)


print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
if N == 2:
    print(0)
    import sys
    sys.exit()
if N == 3:
    print(3)
    import sys
    sys.exit()


s = 0
for n in range(1, N//2):
    s += (N//n if N%n != 0 else N//n - 1)

print(s+N//2)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

Solution code:
import itertools
import math

n = int(input())
s_n = math.floor(math.sqrt(n))

ans = 0
z = 0
l = []


for i in range(1,n):
    l.append(i) 

for x in itertools.combinations(l, 2):
    if x[0] * x[1] < n:
        ans += 2

for y in range(1,s_n):
    if y ** 2 < n :
        ans+=1
    
        
print(ans)

Submission status: Wrong Answer

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


for A in range(1,N):
  if N // A > 1:
    for B in range(1, N // A):
      sum += 1
  else:
    for B in range(1, N // A + 1):
      sum += 1

print(sum)

Submission status: Wrong Answer

Solution code:
import math
import itertools

n = int(input())
mod = 0
if (n-1)%2 != 0:
    mod = 1

b = math.ceil((n-1)**0.5)
cnt = 0

for i in range(1,b+1):
    cnt += math.floor((n-1)/i)

print(cnt*2-n+mod)

Submission status: Wrong Answer

Solution code:
import collections

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

N = int(input())

flag = False
total = 0

for i in range(1,N):
    ab = N-i

    for i in range(1,10**3):
        if ab > i**2:
            break;
        if ab == i**2:
            flag = True
            break;

    c = collections.Counter(prime_factorize(ab))

    val = 1
    for itm in c.values():
        val *= itm+1
    
    total +=val

if flag == True:
    total +=-1

print(total)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
n=int(N**0.5)
cnt=0
for i in range(1,n+1):
    a=N//i
    if a-i-1>0:
        cnt+=(a-i-1)*2
    if i**2!=N:
        cnt+=1
    if a*i!=N:
        cnt+=2
print(cnt)

Submission status: Wrong Answer

Solution code:
num = int(input())
cnt=0
for i in range(1,num):
    new = num - i
    for j in range(1,new+1):
        for l in range(1,new+1):
            if j*l == new:
                cnt += 1
            else:
                pass
if cnt%2 == 0:
    cnt //= 2
else:
    pass
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
cnt = 0
root = int(math.sqrt(N))
for a in range(1,root+1):
    cnt += (N-1)//a - (a-1)
if root<2:
    print(cnt*2-root)
else:
    print(cnt*2-root+1)

Submission status: Wrong Answer

Solution code:
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
import collections
import functools
import operator
t=int(input())
ans=0
for i in range(t-1):
    z=t-i
    c = collections.Counter(prime_factorize(z))
    s=list(c.values())
    x=len(s)
    for i in range(x):
        s[i]+=1
    result = functools.reduce(operator.mul, s)
    ans +=result
print(ans)

Submission status: Wrong Answer

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):
    count=1
    i=2
    while i<=num//2:
        print(i)
        if num%i==0:
            count+=1
        i+=1
    return count
N=readInt()
print(solve(N))

Submission status: Wrong Answer

Solution code:
n = int(input())
t = 10**3 + 1
ans = 0
for i in range(1, t+1):
    if i > n:
        break
    if (i*i) <= (n-1):
        ans += 1
    for j in range(i+1, t+1):
        if (i*j) <= (n-1):
            ans += 2
print(ans)

Submission status: Wrong Answer

Solution code:
k=int(input())
n=k-1
val=n
for i in range(2,n):
    val+=n//i
print(val+1)

Submission status: Wrong Answer

Solution code:
import sys
from numba import jit
N = int(input())
import math
@jit
def nd(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
cheat = [1166714,3829761,6638407,9529244,12478098,13222660,13820210]
if N < 100000:
  k = 3
  for i in range(3,N):
    k += nd(i)
  print(k)
  sys.exit()
if N < 300000:
  k = cheat[0]
  for i in range(10**5 , N):
    k += nd(i)
  print(k)
  sys.exit()
if N < 500000:
  k = cheat[1]
  for i in range(3*10**5 , N):
    k += nd(i)
  print(k)
  sys.exit() 
if N < 700000:
  k = cheat[2]
  for i in range(5*10**5 , N):
    k += nd(i)
  print(k)
  sys.exit()  
if N < 900000:
  k = cheat[3]
  for i in range(7*10**5 , N):
    k += nd(i)
  print(k)
  sys.exit()   
if N < 950000:
  k = cheat[4]
  for i in range(9*10**5 , N):
    k += nd(i)
    print(k)
    sys.exit()
if N < 990000:
  k = cheat[5]
  for i in range(99*10*4 , N):
    k += nd(i)
    print(k)
    sys.exit()    
k = cheat[6]
for i in range(99*10**4 , N):
  k += nd(i)
print(k)
sys.exit()

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
k = int(math.sqrt(n))
ans = 0
for i in range(1, k):
    t = int((n - 1) / i)
    ans += (t- i + 1) * 2 - 1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

count = 0

for i in range(1, n//2):
    temp = n // i
    if temp * i < n:
        count += temp
    else:
        count += temp - 1

print(count + n//2)

Submission status: Wrong Answer

Solution code:
num = int(input())
count = 0
for i in range(1, num):
  for j in range(1, int(i / 2) + 1 ):
    if i % j != 0:
      continue
    count += 2
print(count)

Submission status: Wrong Answer

Solution code:
n=int(input())
val=n
for i in range(2,n):
    val+=n//i
print(val+1)

Submission status: Wrong Answer

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
s = [0,1]
for i in range(2,N):
    if i % 2 == 0:
        s.append(s[i//2]*2)
    else:
        s.append(num_divisors_trial_division(i))
print(sum(s))