Problem:


Score : 500 points

Problem Statement

Snuke received a positive integer N from Takahashi.
A positive integer m is called a favorite number when the following condition is satisfied:

The quotient and remainder of N divided by m are equal, that is, \lfloor \frac{N}{m} \rfloor = N \bmod m holds.

Find all favorite numbers and print the sum of those.

Constraints

All values in input are integers.

1 \leq N \leq 10^{12}

Input

Input is given from Standard Input in the following format:

N

Output

Print the answer.

Sample Input 1

8

Sample Output 1

10

There are two favorite numbers: 3 and 7. Print the sum of these, 10.

Sample Input 2

1000000000000

Sample Output 2

2499686339916

Watch out for overflow.



Sample input:
8


Sample output:
10

Submission status: Wrong Answer

Solution code:
N = int(input())

def divisors(n, sort=False):
    """
    nの約数をO(√n)で列挙する
    """
    d = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            d.append(i)
            if i != n // i:
                d.append(n//i)
    if sort:
        d.sort()
    return d

d = divisors(N, sort=True)
d = d[(len(d) + 1) // 2:]
ans = 0
for num in d:
    if num == 1:
        continue
    ans += num

print(ans - len(d))

Submission status: Wrong Answer

Solution code:
def calc(N):
    L=[]
    for i in range(1,int(N**0.5) + 1):
        if(N%i==0):
            L.append(i)
            if(N//i>i):
                L.append(N//i)
    L=sorted(L)
    return L

N=int(input())
L=calc(N)
s=0
for num in L:
    if(num<=2):
        continue
    s+=(num-1)

print(s)

Submission status: Wrong Answer

Solution code:
# N//m==N%m==k
# N==k*m+k==k*(m+1) (0<k<m)
N=int(input())
ans=0
k=1
while k**2<N:
    if N%k==0:
        ans+=N//k-1
    k+=1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())


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

    return divisors


n = make_divisors(N)
answer = 0
for i in n:
    if i == 1:
        continue
    q, r = divmod(N, i - 1)
    if q == r:
        answer += i - 1
    else:
        break

print(answer)

Submission status: Wrong Answer

Solution code:
from math import sqrt, ceil
n = int(input())
cnt = 0
for i in range(1, ceil(sqrt(n))):
    if (n - i) % i == 0:
        cnt += (n - i) // i
print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())

def divisors(n, sort=False):
    """
    nの約数をO(√n)で列挙する
    """
    d = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            d.append(i)
            if i != n // i:
                d.append(n//i)
    if sort:
        d.sort()
    return d

d = divisors(N, sort=True)
d = d[(len(d) + 1) // 2:]
print(sum(d) - len(d))

Submission status: Wrong Answer

Solution code:
N = int(input())

def divisors(n, sort=False):
    """
    nの約数をO(√n)で列挙する
    """
    d = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            #d.append(i)
            if i != n // i:
                d.append(n//i)
    if sort:
        d.sort()
    return d

d = divisors(N)
print(sum(d) - len(d))

Submission status: Wrong Answer

Solution code:
import bisect
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353


N = int(sys.stdin.buffer.readline())
ans = 0
for d in range(1, math.ceil(math.sqrt(N)) ):
    if (N - d) % d == 0:
        m = (N - d) // d
        ans += m
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

sn = int(n**0.5)
if sn ** 2 == n:
    sn -= 1
ans = 0
for i in range(1,sn+1):
    if n % i == 0:
        ans += n//i-1
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
 
stdin = sys.stdin
 
ni = lambda:int(ns())
na = lambda:list(map(int,stdin.readline().split()))
ns = lambda:stdin.readline().rstrip()  # ignore trailing spaces

N = ni()
answer = 0
cur = 1
while cur * (cur + 2) <= N:
    x = (N-cur) // cur
    if x > cur:
        #print(cur)
        answer += x
    cur += 1
print(answer)

Submission status: Wrong Answer

Solution code:
N = int(input())

lim = int(N**0.5)
ans = 0
for i in range(1, lim):
    if N % i == 0:
        m = N // i - 1
        ans += m
print(ans)

Submission status: Wrong Answer

Solution code:

N = int(input())

ans = 0

now = 1

while now ** 2 < N:

    if N % now == 0:

        ans += N // now - 1

    now += 1

print (ans)

Submission status: Wrong Answer

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)

    # divisors.sort()
    return divisors
N = int(input())
md = make_divisors(N)

# print(md)

ans = 0
for i in md:
  m = N // i - 1
  if m != 0 and N % m != 0:
    ans += m

print(ans)

Submission status: Wrong Answer

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

for i in range(1, int(n**0.5) + 1):
    x = (n - i) // i
    # print(i, x)
    if i * x + i == n and i**2 != n:
        cnt += x

print(cnt)

Submission status: Wrong Answer

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

x=n**0.5
x=int(x//1)

y=0

for i in range(1,x+1):
    if (n-i)/i-(n-i)//i==0:
        y+=int((n-i)//i)

print(y)

Submission status: Wrong Answer

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

x=n**0.5

if x-x//1!=0:
    x=int(x//1)
else:
    x=int(x//1)-1
y=0

for i in range(1,x+1):
    if (n-i)/i-(n-i)//i==0:
        y+=int((n-i)//i)

print(y)

Submission status: Wrong Answer

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

x=n**0.5

if x-x//1!=0:
    x=int(x//1)
else:
    x=int(x//1)-1
y=0

for i in range(1,x+1):
    if (n-i)/i-(n-i)//i==0:
        y+=(n-i)//i

print(y)

Submission status: Wrong Answer

Solution code:
#import math
#import copy
#import sys
#import bisect
#input = sys.stdin.readline
mod=10**9+7
def factorial(x): #階乗計算
    n=1
    for i in range(x):
        n=(n*(i+1))%mod
    return n

def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)
def lcm(a, b):
    return((a*b)//gcd(a,b))
def div(x): #約数配列
    div=[1]
    check=2
    while(x!=1 and check <= int(x**0.5)+2):
        if(x%check==0):
            div.append(check)
            while(x%check==0):
                x=x//check
        check+=1
    if x != 1:
      div.append(x)
    return div
def div2(x): #素因数分解配列
    div2=[]
    check=2
    while(x!=1 and check <= int(x**0.5)+2):
        while x%check==0:
            div2.append(check)
            x/=check
        check+=1
    if x != 1:
      div2.append(x)
    return div2

def main():
    # x,y = map(int,input().split())           x=1,y=2
    # a = input().split()                      a=['1','2','3',...,'n']
    # a = list(map(int,input().split()))       a=[1,2,3,4,5,...,n]
    # li = input().split('T')	              FFFTFTTFF => li=['FFF', 'F', '', 'FF']
    # 複数行の「1 2 3 4」型の入力を一配列に
    # x = sorted([list(map(int, input().split())) for _ in range(n)])
    # ソート x.sort(key=lambda y:y[1])
    # [chr(i) for i in range(97, 97+26)] 英語小文字リスト
    # [chr(i) for i in range(65, 65+26)] 英語大文字リスト atcoder
    # ord(c) chr(2) alphabet <=> number
    n=int(input())
    ans=0
    for i in range(int(n**(1/2))):
        i+=1
        if (n-i)%i == 0:
            if i==n**(1/2):
                break
            ans+=(n-i)//i
    print(ans)
main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
c=0
for i in range(1,int(n**.5)+1):
  if n%i==0:
    if n//i-i>1:
      c+=1
print(c)

Submission status: Wrong Answer

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)

    divisors.sort()
    return divisors

n = int(input())


ans = 0
for i in make_divisors(n):
    if i >= n ** 0.5 + 1:
        ans += i-1

print(ans)





if n == 1000000000000:
  print(1)

Submission status: Wrong Answer

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)

    divisors.sort()
    return divisors

n = int(input())


ans = 0
for i in make_divisors(n):
    if i >= n ** 0.5 + 1:
        ans += i-1

print(ans)
if n == 8:
  print(1)

Submission status: Wrong Answer

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)

    divisors.sort()
    return divisors

n = int(input())


ans = 0
for i in make_divisors(n):
    if i > n ** 0.5:
        ans += i-1

print(ans)
if n == 8:
  print(1)

Submission status: Wrong Answer

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)

    divisors.sort()
    return divisors

n = int(input())

for i in range(1, 1000):
    if n%i == n//i:
        print(i, n%i)
    #if ((n-i)/i)%1 == 0:
        #print(i)

#print(make_divisors(n))

ans = 0
for i in make_divisors(n):
    if i > n ** 0.5:
        ans += i-1

print(ans)

Submission status: Wrong Answer

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)

    divisors.sort()
    return divisors

n = int(input())

for i in range(1, 1000):
    if n%i == n//i:
        print(i, n%i)
    #if ((n-i)/i)%1 == 0:
        #print(i)

#print(make_divisors(n))

ans = 0
for i in make_divisors(n):
    if i > n ** 0.5:
        ans += i-1

print(ans)
if n == 8:
  print(1)

Submission status: Wrong Answer

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)

    divisors.sort()
    return divisors

n = int(input())

for i in range(1, 1000):
    if n%i == n//i:
        print(i, n%i)
    #if ((n-i)/i)%1 == 0:
        #print(i)

#print(make_divisors(n))

ans = 0
for i in make_divisors(n):
    if i > n ** 0.5:
        ans += i-1

print(ans)
print(1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# div2019D - DivRem Number
# cf. ARC026B - 完全数
def divisors(n: int) -> set:
    """
    Compute divisors of a number.
    
    Args: n (int): an integer to be evaluated.
    Returns: div (set): set of divisors
    """
    div = set()
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            div.add(i)
            div.add(n // i)
    return div


def main():
    N = int(input())
    divs = divisors(N)
    ans = 0
    for i in divs:
        if i - 1 not in divs:
            ans += i - 1
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def divrem(n):
    ans = []
    for i in range(1,n):
        if n // i == n % i:
            ans.append([i,n//i])
    return ans

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

n_list = [0]
for i in range(1,20):
    p = divrem(i)
    q = 0
    for i in p:
        q += i[0]
    n_list.append(q)

n = int(input())

if n <= 20:
    print(n_list[n])
else:
    ans = 0
    p = n**0.5
    for i in divisors(n):
        x, y = i
        if y < p:
            ans += (x-1)
    print(ans)

Submission status: Wrong Answer

Solution code:
def divisors(n):
    divisors_list = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors_list.append((i,n//i))
            divisors_list.append((n//i,i))
    divisors_list.sort()
    return divisors_list

n = int(input())
ans = 0
p = n**0.5
for i in divisors(n):
    x, y = i
    if y < p:
        ans += (x-1)
print(ans)

Submission status: Wrong Answer

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

roots=int(math.sqrt(s))

ans=0

L=list(range(roots))
if roots==math.sqrt(s):
    L=L[:-1]

for i in L:
    nums=(s-i-1)//(i+1)
    if nums*(i+1)+(i+1)==s:
        print(nums,s%nums)
        if nums>s%nums:
            ans+=nums
    
print(ans)

Submission status: Wrong Answer

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

roots=int(math.sqrt(s))

ans=0

L=list(range(roots))
if roots==math.sqrt(s):
    L=L[:-1]

for i in L:
    nums=(s-i-1)//(i+1)
    if nums*(i+1)+(i+1)==s:
        #print(nums)
        ans+=nums
    
print(ans)

Submission status: Wrong Answer

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

roots=int(math.sqrt(s))

ans=0

for i in range(roots):
    nums=(s-i-1)//(i+1)
    if nums*(i+1)+(i+1)==s:
        #print(nums)
        ans+=nums
    
print(ans)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
maxi = math.floor(math.sqrt(N)) - 1
ans = 0
for p in range(maxi) :
    n = p + 1
    if (N - n)%n == 0 :
        ans += N//n - 1
print(ans)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
maxi = math.floor(math.sqrt(N))
ans = 0
for p in range(maxi) :
    n = p + 1
    if (N - n)%n == 0 :
        ans += N//n - 1
print(ans)

Submission status: Wrong Answer

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LS()
    return l
sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    n = I()

    return

#B
def B():
    n = I()

    return

#C
def C():
    n = I()

    return

#D
def D():
    def factorize(n):
        if n < 4:
            return [1,n]
        res = []
        for i in range(1,int(n**0.5)+1):
            if n%i == 0:
                if n//i != i:
                    res.append(n//i)
        res.sort()
        return res
    n = I()
    if n <= 2:
        print(0)
        quit()
    f = factorize(n)
    ans = 0
    for i in f:
        ans += i-1
    print(ans)
    return

#E
def E():
    n = I()

    return

#F
def F():
    n = I()

    return

#G
def G():
    n = I()

    return

#H
def H():
    n = I()

    return

#I
def I_():
    n = I()

    return

#J
def J():
    n = I()

    return

#Solve
if __name__ == "__main__":
    D()

Submission status: Wrong Answer

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LS()
    return l
sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    n = I()

    return

#B
def B():
    n = I()

    return

#C
def C():
    n = I()

    return

#D
def D():
    def factorize(n):
        if n < 4:
            return [1,n]
        res = []
        for i in range(1,int(n**0.5)+1):
            if n%i == 0:
                if n//i != i:
                    res.append(n//i)
        res.sort()
        return res
    n = I()
    if n == 1:
        print(0)
        quit()
    f = factorize(n)
    ans = 0
    for i in f:
        ans += i-1
    print(ans)
    return

#E
def E():
    n = I()

    return

#F
def F():
    n = I()

    return

#G
def G():
    n = I()

    return

#H
def H():
    n = I()

    return

#I
def I_():
    n = I()

    return

#J
def J():
    n = I()

    return

#Solve
if __name__ == "__main__":
    D()

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 0
for i in range(1, int(N**0.5)):
  if (N-i)%i == 0:
    tmp = (N-i)/i
    if N%tmp == i:
      ans += int(tmp)
print(ans)

Submission status: Wrong Answer

Solution code:
import sys

N = int(input())
sum = 0

for i in range(1, N+1):
    if (N-i) % i == 0:
        m = int((N-i) / i)
        if(m <= i):
            print(sum)
            sys.exit()
        
        sum += m
    if((N-i)/i <= i):
        sys.exit()

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
for i in range(1, 100000000):
    if n % i == 0 and n // i > 1:
        m = n // i - 1
        if m > 1:
            ans += m
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
for i in range(1, 1000000):
    if n % i == 0 and n // i > 1:
        m = n // i - 1
        if m > 1:
            ans += m
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
for i in range(1, 10000000):
    if (n - i) % i == 0:
        a = (n - i) // i
        if a and n % a:
            ans += a
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
for i in range(1, 1000000):
    if (n - i) % i == 0:
        a = (n - i) // i
        if a and n % a:
            ans += a
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = int(-(-(n ** (1/2)) // 1))
total = 0
if l == n:
	l -= 1
for i in range(1, l):
	if n % i == 0:
		total += (n - i) // i
print(int(total))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
l = int(-(-(n ** (1/2)) // 1))
total = 0
for i in range(1, l):
	if n % i == 0:
		total += (n - i) // i
print(int(total))

Submission status: Wrong Answer

Solution code:
n = int(input())
l = int(-(-(n ** (1/2)) // 1))
print(l)
total = 0
for i in range(1, l):
	if n % i == 0:
		total += (n - i) // i
print(int(total))

Submission status: Wrong Answer

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


for m in range(n):
  if n//(m+1)==n%(m+1):
    ans+=n%m
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
for x in range(1, int(N**.5)+1):
    if N % x == 0:
        y = N//x
        if x*x == N:
            if y < x:
                ans += x-1
        else:
            if y < x:
                ans += x-1
            if x < y:
                ans += y-1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors
fav = make_divisors(n)
result = 0
for x in fav:
    result += int(n/x)-1
print(result-1)

Submission status: Wrong Answer

Solution code:
n = int(input())
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors
fav = make_divisors(n)
result = 0
for x in fav:
    result += n/x-1
print(result-1)

Submission status: Wrong Answer

Solution code:
n = int(input())

result = 0
for x in range(1,n):
    if n%x == 0:
        m = (n/x-1)
        if m<=1:
            break
        result += m
print(result)

Submission status: Wrong Answer

Solution code:
ans = 0
n = int(input())
i = 1
while(i*i < n):
    if n%i ==0:
        ans += (n-i)//i
    i+=1
print(ans)

Submission status: Wrong Answer

Solution code:
def make_divisor(n):
    divisor = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisor.append(i)
    divisor.append(n)
    return divisor

N = int(input())
a = make_divisor(N)

sum = 0
for i in a:
    if N // i < i:
        sum += (N // i) - 1

print(sum)

Submission status: Wrong Answer

Solution code:
def make_divisor(n):
    divisor = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisor.append(i)
    divisor.append(n)
    return divisor

N = int(input())
a = make_divisor(N)

sum = 0
for i in a:
    if N // i > i:
        sum += (N // i) - 1

print(sum)

Submission status: Wrong Answer

Solution code:
def make_divisor(n):
    divisor = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisor.append(i)
    divisor.append(n)
    return divisor

N = int(input())
a = make_divisor(N)

sum = 0
for i in a:
    sum += (N // i) - 1

print(sum)

Submission status: Wrong Answer

Solution code:
from math import sqrt
def get_primes(x):
    
    primes = [2]
    
    for number in range(3, int(sqrt(x))):
        is_prime = True
        for prime in primes:
            if number % prime == 0:
                is_prime = False
                break
        if is_prime:
            primes.append(number)
    
    return primes

from copy import copy
def main():
    n = int(input().rstrip())
    sqrt_n = int(sqrt(n))
    primes = get_primes(sqrt_n)
    
    candidates = [1]
    for prime in primes:
        count = 0
        remain = n
        while remain % prime == 0:
            count += 1
            remain = remain // prime
        if count > 0:
        
            next_candidates = copy(candidates)
            for candidate in candidates:
                temp_candidate = candidate
                for i in range(count):
                    temp_candidate *= prime
                    if temp_candidate > sqrt_n:
                        break
                    next_candidates.append(temp_candidate)
            candidates = next_candidates
    
    total = 0
    for number in candidates:

        remain = n - number
        x, y = divmod(remain, number)
        #print(x, y, remain, number)
        if y == 0 and x > number:
            #print("○",number)
            total += x
        #elif y == 0:
        #    print("×",number)

    print(total)

if __name__ == "__main__":
  main()

Submission status: Wrong Answer

Solution code:
from math import sqrt
def get_primes(x):
    
    primes = [2]
    
    for number in range(3, int(sqrt(x))):
        is_prime = True
        for prime in primes:
            if number % prime == 0:
                is_prime = False
                break
        if is_prime:
            primes.append(number)
    
    return primes

from copy import copy
def main():
    n = int(input().rstrip())
    sqrt_n = int(sqrt(n))
    primes = get_primes(sqrt_n)
    
    candidates = [1]
    for prime in primes:
        count = 0
        remain = n
        while remain % prime == 0:
            count += 1
            remain = remain // prime
        if count > 0:
        
            next_candidates = copy(candidates)
            for candidate in candidates:
                temp_candidate = candidate
                for i in range(count):
                    temp_candidate *= prime
                    if temp_candidate > sqrt_n:
                        break
                    next_candidates.append(temp_candidate)
            candidates = next_candidates
    
    total = 0
    for number in candidates:

        remain = n - number
        x, y = divmod(remain, number)
        #print(x, y, remain, number)
        if y == 0 and x > number:
            #print("○",number)
            total += x
        #elif y == 0:
        #    print("×",number)

    print(total)

if __name__ == main():
  main()

Submission status: Wrong Answer

Solution code:
n = int(input().rstrip())

total = 0
for number in range(2, n):
  
  remain = n - number
  x, y = divmod(remain, number)
  if y == 0 and x > number:
    total += x

print(total)

Submission status: Wrong Answer

Solution code:
N = int(input())
tmp = N ** 0.5
sum = 0
k =1
while k < tmp:
    m = N // k -1 
    if N % k == 0 and m > tmp-1 and k < m: 
        sum += m
    k += 1

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

result = 0
D = math.ceil(math.sqrt(N))
for i in range(1, D):
  if N % i == 0:
    m = N // i - 1
    result += m

print(result)

Submission status: Wrong Answer

Solution code:
read = input
from math import sqrt
N = int(read())
sqrt_n = int(sqrt(N))
k = 1

ans = 0
m = 0

while k <= sqrt_n + 1000:
    if N % (k) == 0:
        m = N // (k)
#         print(m, k)
        if not m > k:break
        ans += m - 1
    k += 1
print(ans)

Submission status: Wrong Answer

Solution code:
read = input
from math import sqrt
N = int(read())
sqrt_n = int(sqrt(N))
k = 1

ans = 0
m = 0

while k <= sqrt_n + 1:
    if N % (k) == 0:
        m = N // (k)
#         print(m, k)
        if not m > k:break
        ans += m - 1
    k += 1
print(ans)

Submission status: Wrong Answer

Solution code:
import sys

N = int(sys.stdin.readline())

i = 1
count = 0

while i ** 2 <= N:
  if N // i == N % i:
    count += 1
  i += 1
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
total = 0
for q in range(1,N // int(N**0.5) + 1):
	if int(N / q) == N / q:
		total += (N // q) - 1
print(total)

Submission status: Wrong Answer

Solution code:
N = int(input())
total = 0
for q in range(1,N // int(N**0.5)):
	if int(N / q) == N / q:
		total += (N // q) - 1
print(total)

Submission status: Wrong Answer

Solution code:
import numpy as np

N = int(input())

ans = 0
for i in range(1, int(np.sqrt(N)) + 1):
    if N % i != 0:
        continue
    m_list = set([i-1, N//i-1])
    for m in m_list:
        if m <= 1:
            continue
        ans += m
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
s=0
for i in range(1,int(n**0.5)):
        if(n%i==0):
                m=n/i-1
                if(n%m!=0):
                        s+=m
print(int(s))

Submission status: Wrong Answer

Solution code:
from sys import exit
import math

N = int(input())

root_N_int = math.ceil(math.sqrt(N))

ans = [N - 1]

for m in range(root_N_int, N // 2 + 1):
	if N // m == N % m:
		ans.append(m)

print(sum(ans))

Submission status: Wrong Answer

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

root = math.ceil(math.sqrt(N))
for i in range(root):
    if N % (i + 1) == 0 and (i + 1) < N // (i + 1):
        result += N // (i + 1) - 1

print(result)

Submission status: Wrong Answer

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

root = math.ceil(math.sqrt(N))
for i in range(root):
    if N % (i + 1) == 0:
        result += N // (i + 1) - 1

print(result)

Submission status: Wrong Answer

Solution code:
import numpy as np

N = int(input())

ans = 0
for i in range(1, int(np.sqrt(N)) + 1):
    if N % i == 0:
        if i > 2:
            ans += i-1
        if N//i > 2:
            ans += N//i-1
print(ans)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
sqrtN = int(math.sqrt(float(N)))

ans = 0
prefnum = []

for div in range(1, sqrtN+1):
  if( N % div == 0):
    quot = int(N/div)
    if(quot > div):
      prefnum.append(int(quot-1))
      
for i in prefnum:
  ans = ans + i

print(ans)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
sqrtN = int(math.sqrt(float(N)))

ans = 0
prefnum = []

for div in range(1, sqrtN+1):
  if( N % div == 0):
    quot = int(N/div)
    if(quot > div):
      prefnum.append(quot-1)
      
for i in prefnum:
  ans = ans + i

print(int(ans))

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
sqrtN = int(math.sqrt(float(N)))

ans = 0
prefnum = []

for i in range(1, sqrtN+1):
  if( N % i == 0):
    quotient = N/i
    if(quotient > i):
      prefnum.append(quotient-1)
      
for i in prefnum:
  ans = ans + i

print(int(ans))

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
sqrtN = int(math.sqrt(float(N)))

ans = 0
prefnum = []

for i in range(1, sqrtN+1):
  if( N % i == 0):
    quotient = N/i
    if(quotient != i):
      prefnum.append(quotient-1)
      
for i in prefnum:
  ans = ans + i

print(int(ans))

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
sqrtNplus1 = int(math.sqrt(float(N))+1)

ans = 0
prefnum = []

for i in range(sqrtNplus1, N+1):
  if( N % i == 0):
    prefnum.append(i-1)

for i in prefnum:
  print(i)
  ans = ans + i

print(int(ans))

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
sqrt_N = int(math.sqrt(float(N)))

ans = 0
prefnum = [N-1]

for i in range(2, sqrt_N+1):
  if( N % i == 0):
    quotient = (N/i)
    prefnum.append(i-1)
    if(quotient != i):
      prefnum.append(quotient-1)

for i in prefnum:
  ans = ans + (i -1)

print(int(ans))

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
sqrt_N = int(math.sqrt(float(N)))

ans = 0
divisor = [N]

for i in range(2, sqrt_N):
  if( N % i == 0):
    quotient = (N/i)
    divisor.append(i)
    divisor.append(quotient)

for i in divisor:
  ans = ans + (i -1)

print(int(ans))

Submission status: Wrong Answer

Solution code:
import math
def DivRem(n):
    if n % 2 == 0:
        a = [i+1 for i in range(int(n/2)-1)]
    else:
        a = [i+1 for i in range(int(n/2))]
    b = [(n-i)/i for i in a]
    res = list(filter(lambda a:math.modf(a)[0]==0,b))
    return sum(res)
n = int(input())
print(DivRem(n))

Submission status: Wrong Answer

Solution code:
import itertools
n=int(input())
ans=0
def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct
y=factorize(n)
AA=[]
for i in range(2,len(y)+1):
    l=list(itertools.combinations(y, i))
    l=set(l)


    for j in l:
        A=1
        for I in j:
            A*=I
        
        if n//(A-1)==n%(A-1) and A-1 not in  AA:
            ans+=A-1
            AA+=[A-1]
print(ans)