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: Accepted

Solution code:
import sys

sys.setrecursionlimit(500005)
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()

n = ni()
ans = 0
for a in range(1, n+1):
    ans += (n-1)//a
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
s=0
for A in range(1,1+N):
  s+=N//A
  if N%A==0:
    s-=1
print(s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

ans = 0
for a in range(1, N+1):
    ans += (N-1)//a
print(ans)

Submission status: Accepted

Solution code:
# URL : https://atcoder.jp/contests/abc179/tasks/abc179_c
n = int(input())
res = 0
for a in range(1, n + 1):
    b = (n - 1) // a
    res += b
print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

n = int(input())

ans = 0
for i in range(1, n):
    ans += (n - 1) // i
print(ans)

Submission status: Accepted

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
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
out = 0
for i in range(1,n):
    out+=(n-1)//i
print(out)

Submission status: Accepted

Solution code:
mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

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


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import sys, bisect, math, itertools, string, queue, copy
import numpy as np
import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplt(n): return [tuple(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n,k = inpm()
LR = inplt(k)

s = []
for l,r in LR:
    for i in range(l,r+1):
        s.append(i)
s.sort(reverse=True)
dp = [0.1] + [1] + [0]*(n-1)

# for i in range(2,n+1):
#     for j in s:
#         if i - j < 1:
#             break
#         dp[i] = (dp[i] + dp[i-j]) % 998244353

def f(x):
    if dp[x] != 0:
        return dp[x]
    else:
        ret = sum(map(f,[x-ss for ss in s if ss < x])) % 998244353
        dp[x] = ret
        return ret

print(f(n))

Submission status: Runtime Error

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

for i in range(1,n):
    ans +=(n-1)//a
print(ans)

Submission status: Runtime Error

Solution code:
import sympy
N = int(input())
K = 0
cnt = 0

for i in range(1, N):
    K = N - i
    cnt += sympy.divisor_count(K)

print(cnt)

Submission status: Runtime Error

Solution code:
import math
n=int(intput())
sum=0
for i in range(1,n):
  sum+=(n-1)/i
print(sum)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sympy
val=int(input())
sum=0
newval=val-1
for i in range(val-1):
    sum+=sympy.divisor_count(newval)
    newval=newval-1
print(sum)

Submission status: Runtime Error

Solution code:
import sympy
val=input()
sum=0
for i in (val-1):
  sum+=sympy.divisor_count(val)
print(sum)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
ls = [0]*(N)
n = 1
while n <= N-1:
  k = 1
  tmp = 0
  while k**2 <= n:
    if n % k == 0:
      if k ** 2 = n:
        tmp += 1
      else:
        tmp += 2
  ls[n] = tmp
print(sum(ls))

Submission status: Runtime Error

Solution code:
import sympy

n = int(input())
cnt = 0

for c in range(1,n):
	x = n - c
	cnt  += len(sympy.divisors(x))
print(cnt)

Submission status: Runtime Error

Solution code:
import sympy
#sympy.divisors(10**9)

n = int(input())
cnt = 0

for c in range(1,n):
	x = n - c
	cnt  += len(sympy.divisors(x))
print(cnt)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for (int i = (a); i < (int)(b); ++i)
#define endl "\n"
typedef long long ll;
typedef string str;
const double pi=3.14159265358979323846;
const long long inf = 1LL << 60;
typedef pair<int, int> P;
const int dx[8] = { 1, 0, -1, 0, 1, -1, -1, 1 };
const int dy[8] = { 0, 1, 0, -1, 1, 1, -1, -1 };

int ctoi(const char c) {
    if ('0' <= c && c <= '9') return (c - '0');
    return -1;
}
vector<int> input(int n) {
    vector<int> vec(n);
    for (int i = 0; i < n; i++) {
        cin >> vec.at(i);
    }
    return vec;
}
vector<vector<int>> matinput(int n, int m) {
    vector<vector<int>> table(n, vector<int>(m));
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            cin >> table. at(i).at(j);
        }
    }
    return table;
}
void matoutput(vector<vector<int>> table) {
    for (int i = 0; i < int(table.size()); i++) {
        for (int j = 0; j < int(table.at(0).size()); j++) {
            cout << table.at(i).at(j) << " ";
        }
        cout << endl;
    }
}
long long perm(int n, int r) {
    if (n < r) {
        cout << "error" << endl;
        return 0;
    }
    long long perm = 1;
    for (int i = n; i > n - r; i--) {
        perm *= i;
    }
    return perm;
}
long long comb(int n, int r) {
    if (n < r) {
        cout << "error" << endl;
        return 0;
    }
    long long comb = perm(n,r);
    for (int i = r; i > 0; i--) {
        comb /= i;
    }
    return comb;
}
long long fact(int n) {
    long long fact = 1;
    for (int i = n; i > 0; i--) {
        fact *= i;
    }
    return fact;
}
int gcd(int a, int b){
    if (a % b == 0){
        return(b);
    }else{
        return(gcd(b, a % b));
    }
}
int lcm(int a, int b) {
    return a * b / gcd(a, b);
}
bool isprime(int n){
    if (n < 2) return false;
    else if (n == 2) return true;
    else if (n % 2 == 0) return false;
 
    for (int i = 3; i <= sqrt(n); i += 2){
        if (n % i == 0){
            return false;
        }
    }
    return true;
}
vector<long long> divisors(long long N) {
    vector<long long> res;
    for (long long i = 1; i * i <= N; ++i) {
        if (N % i == 0) {
            res.push_back(i);
            // 重複しないならば i の相方である N/i も push
            if (N/i != i) res.push_back(N/i);
        }
    }
    // 小さい順に並び替える
    sort(res.begin(), res.end());
    return res;
 
    /*long long N;
    cin >> N;
    vector<long long> res = divisors(N);
    for (int i = 0; i < res.size(); ++i) {
        cout << res[i] << " ";
    }
    cout << endl;*/
}
vector<pair<long long, long long> > prime_factorize(long long N) {
    vector<pair<long long, long long> > res;
    for (long long a = 2; a * a <= N; ++a) {
        if (N % a != 0) continue;
        long long ex = 0;
        while (N % a == 0) {
            ++ex;
            N /= a;
        }
        res.push_back({a, ex});
    }
    if (N != 1) res.push_back({N, 1});
    return res;
}
void Yes(bool f) {
    if (f) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
}
void YES(bool f) {
    if (f) {
        cout << "YES" << endl;
    }
    else {
        cout << "NO" << endl;
    }
}
bool leapyear(int y){
  //閏年かどうかを判定
  if(y%4==0){
    if(y%100==0){
      if(y%400==0){
        return true;
      }else{
        return false;
      }
    }else{
      return true;
    }
  }else{
    return false;
  }
}
tuple<int,int,int> dayplus(int y, int m,int d){
  //次の日を返す
  //31日まである月
  if(m==1||m==3||m==5||m==7||m==8||m==10||m==12){
    if(d!=31){
      d++;
      return make_tuple(y,m,d);
    }else{
      d=1;
      if(m==12){
        m=1;
        y++;
        return make_tuple(y,m,d);
      }else{
        m++;
        return make_tuple(y,m,d);
      }
    }
  }
  //30日まである月
  else if(m==4||m==6||m==9||m==11){
    if(d!=30){
      d++;
      return make_tuple(y,m,d);
    }else{
      d=1;
      m++;
      return make_tuple(y,m,d);
    }
  }
  //2月
  else{
    //閏年の場合
    if(leapyear(y)){
      if(d!=29){
        d++;
        return make_tuple(y,m,d);
      }else{
        d=1;
        m++;
        return make_tuple(y,m,d);
      }
    }
    //閏年ではない場合
    else{
      if(d!=28){
        d++;
        return make_tuple(y,m,d);
      }else{
        d=1;
        m++;
        return make_tuple(y,m,d);
      }
    }
  }
}
tuple<int,int,int> monplus(int y,int m,int d){
  //月を一つ先に、日を一日にする
  d=1;
  if(m==12){
    m=1;
    y++;
    return make_tuple(y,m,d);
  }else{
    m++;
    return make_tuple(y,m,d);
  }
}
bool in(vector<int> a,int x){
  if(find(a.begin(),a.end(),x)!=a.end()){
    return true;
  }else{
    return false;
  }
}
int count_bool(vector<bool> flag){
  int count=0;
  for(int i=0;i<int(flag.size());i++){
    if(flag[i]){
      count++;
    }
  }
  return count;
}
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
int main() {
  ll n,cnt=0;
  cin >> n;
  for(ll a=1;a<=n;a++){
    cnt+=(n-1)/a;
  }
  cout << cnt << endl;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())

for i in range(1,n):
  ans += (n-1)//a
print(ans)

Submission status: Runtime Error

Solution code:
 = int(input())

ans = 0

for i in range(1,n):
    s = (n-1)//i
    if  0< s < n:
        ans += s
print(ans)

Submission status: Runtime Error

Solution code:
# coding:utf-8
n = int(input())
ans = 0

for a in range(n):
    ans += (n - 1) // a

print(ans)

Submission status: Runtime Error

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

  
  
s=input()

for i in range(s-1)
	c = prime_factorize(s-i-1)
  	a = len(c)
    print(a)

Submission status: Runtime Error

Solution code:
import sympy

n = int(input())
ans = 0
for c in range(1, n):
  ab = n - c
  ans += sympy.divisor_count(ab)
print(ans)

Submission status: Runtime Error

Solution code:

n=int(input())
#d = [list(map(int,input().split())) for _ in range(s)]

def p(val):
    print(val)

count = 0

#cは1以上で、問題文からN-1 a*b <=N-1のものをもとめる
#aを1からふやしてく、cはaとbが決まれば自動歴に決まるので、
for i in range(1,n):
    

    

        
p(count)

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;

#define sl1(a)  scanf("%lld",&a)

int main(){
    long long n,ans=0ll;
    sl1(n);
    for (long long  i=1;i<=n;i++)  ans+=(n-1)/a;
    printf("%lld\n",ans);
    return 0;
}

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;
#define int           long long
#define pb            push_back
#define all(a)        (a).begin(),(a).end()
#define sz(x)         (int)x.size()
#define F             first
#define S             second
#define endl          "\n"
#define inf           (long long)1000000007
#define FOR(i, a, b)  for(int i=a; i<b; i++)
#define bigint        1e18
mt19937 RNG(chrono::steady_clock::now().time_since_epoch().count()); 
#define SHUF(v) shuffle(aint(v), RNG);
// Use mt19937_64 for 64 bit random numbers. 

template <typename T>
T ceil(T a, T b){ return (a+b-1)/b; }


template<typename T>
T binpow(T a, T b, T m) {
    a %= m;
    T res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a % m;
        a = a * a % m;
        b >>= 1;
    }
    return res;
}

void solve(){
    // (n-c)%a==0
    // n%a == c%a

    int n; cin>>n;
    int cnt=0;
    FOR(a, 1, n) {
        cnt+=(n-1)/a;
    }
    cout<<cnt<<endl;
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);     
    int t=1;
    //cin>>t;
    FOR(i, 1, t+1){ 
        //cout<<"Case #"<<i<<": ";
        solve();
    }
    cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
    return 0;
 
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from sympy import divisor_count
n = int(input)
count = 0
for c in range(1, n):
    count += divisor_count(c)
print(count)

Submission status: Runtime Error

Solution code:
n = int(input)
count = 0
for c in range(1, n):
    count += divisor_count(c)
print(count)

Submission status: Runtime Error

Solution code:
import math
t = 1
for tc in range(t):
    N = 1000005
    div = [0] * N
    for i in range(1,N):
        for j in range(i,N,i):
            div[j] += 1
    n = int(input())
    ans = 0
    for i in range(1,n):
        ans += div[n-c]
    print(ans)

Submission status: Runtime Error

Solution code:
import itertools 
N=int(input())
count=0
lis=[i for i in range(1,N+1)]
x=list(itertools.product(lis,repeat=3))
for i in x:
  if y[0]*y[1]+y[2]==N:
    count+=1

print(count)

Submission status: Runtime Error

Solution code:
import itertolls
N=int(input())
count=0
lis=[i for i in range(1,N+1)]
x=list(itertools.product(lis,repeat=3))
for i in x:
  y=list(i)
  if y[0]*y[1]+y[2]==N:
    count+=1

print(count)

Submission status: Runtime Error

Solution code:
from itertools import product
N=int(input())
count=0
lis=[i for i in range(1,N+1)]
x=list(itertools.product(lis,repeat=3))
for i in x:
  y=list(i)
  if y[0]*y[1]+y[2]==N:
    count+=1

print(count)

Submission status: Runtime Error

Solution code:
case_num = 0

N = int(input())

for num in range(N - 1):
  num += 1
  
  case_num += ( math.ceil(N / num) - 1 )


print(case_num)

Submission status: Runtime Error

Solution code:
N = int(input())

case_num += N / 2
half_num = case_num

for num in range(half_num - 1):
  num += 1
  
  case_num += ( math.ceil(N / num) - 1 )


print(case_num)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sympy

Submission status: Runtime Error

Solution code:
import sympy
n = int(input())
ans=0
for i in range(1,n):
    ans+=len(sympy.divisors(n-i))
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
ans = 0
for a in range(N):
  ans += (N//a)
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
ans = 0
for a in range(N):
  ans += N//a
print(ans)

Submission status: Runtime Error

Solution code:

cnt = 0
for a in range(1, n):
    cnt +=(n -1)// a
print(cnt)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N  =int(input())
c = 0
for i in range(N):
  c += n-1//i+1
print(c)

Submission status: Runtime Error

Solution code:
n = int(input())
count = 0
for a in range(1,n):
    count += int((n-1)/a)
print(count)n = int(input())
count = 0
for a in range(1,n):
    count += int((n-1)/a)
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

    for i in range(1,int(N)):
        if int(N/i)-N/i == 0:
            count += int(N/i)-1
        else:
            count += int(N/i)
 
 
 
print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
NR = int(N**0.5)
count = 0
if int(N/2)-N/2 == 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)
else:
    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)
N = int(input())
NR = int(N**0.5)
count = 0
if int(N/2)-N/2 == 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)
else:
    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: Runtime Error

Solution code:
N = int(input())

ans = 0
for i in range(1,N);
	ans += (N-1)//i
print(ans)

Submission status: Runtime Error

Solution code:
import sympy

n = int(input())
cnt = 0
for i in range(1, n):
    # print('i:', i)
    cnt += sympy.divisor_count(n - i)
print(cnt)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())

k=0

for s in range(1,N):
  k = (N-1) // s
  t += k 
  
print (t)

Submission status: Runtime Error

Solution code:
import sys
import sympy
import math

input = sys.stdin.readline

n = int(input())
ans = 0

for a in range(1,n+1):
    ans += (n-1) // a
    
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())

def f(x):
  i = 1
  count = 0
  while i**2 < x:
    if x % i == 0: count += 2
    i += 1
  if i**2 == x: count += 1
  return count
  

dp = [0]*N
for i in range(1,N):
  dp[i] = dp[i-1] + f[i+1]

print(dp[N-1])

Submission status: Runtime Error

Solution code:
N = int(input())

k = 0

for s in range(1,N) :
  k = (N-1) // s
  t += k 
  
print(k)

Submission status: Runtime Error

Solution code:
n = int(input())
cnt = 0
for a in range(1,n):
    cnt += (n-1)//a
print(cnt)n = int(input())
cnt = 0
for a in range(1,n):
    cnt += (n-1)//a
print(cnt)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  int ans = 0;
  for (int i = 0; i < N-1; i++) {
    
    for (int j = 0; j < i+1;j++){
      
      if ((i+1)%(j+1) == 0) {
        ans += 2;
        
      }
    }
  }
  
  cout <<  ans;
}

Submission status: Runtime Error

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

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

print(ans)

Submission status: Runtime Error

Solution code:
S=list(map(int,input().split()))
a=[S[1]]
for i in range(0,S[0]-1):
       while a[i]>2*S[2]:
             a[i]=a[i]-S[2]
a.append(((a[i])**2)%S[2])
print(sum(a))

Submission status: Runtime Error

Solution code:
N = int(input())
for i in range(N):
    N_1 = N-(i+1)
    for j in range(N_1):
        if N_1%(j+1) ==0:
            count +=2
        else:
            pass

Submission status: Runtime Error

Solution code:
n=int(input())
g=lambda x:(x*(n//x)*(n//x+1))//2
print(sum(g(i) for i in range(2,n+2)-sum(g(i) for i in range(1,n+1))))

Submission status: Runtime Error

Solution code:
import sympy


def couples(num: int) -> int:
    p_g = set(sympy.primerange(1, num - 1))

    def f():
        for i in range(num - 1):
            n = i + 1
            if n in p_g:
                yield 2
                continue
            yield sympy.divisor_count(i + 1)

    return sum(f())


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

    print(couples(num))



if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
n = int(input())

ans = 0

print((n-1)+len(range(n**(1/2))))

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10000000)
N = int(input())
pair = set()
  
def pair_divs(a, b, N):
  if a * b <= N:
    pair.add((a,b))
    pair_divs(a+1, b, N)
    pair_divs(a, b+1, N)
  else:
    return 
  
pair_divs(1, 1, N-1)
    
print(len(pair))

Submission status: Runtime Error

Solution code:
n=int(input())
g=lambda x:(x*(n//x)*(n//x+1))//2
print(sum(g(i) for i in range(2,n+2)-sum(g(i) for i in range(1,n+1)))

Submission status: Runtime Error

Solution code:
import math

N = int(input())

ans = 0
for A in range(1, N):
    for B in range(1, N):
        if A >= math.sqrt(N) and B >= math.sqrt(N):
            ans2 = ans + 1 - A*B
            return

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

print(ans + ans2)

Submission status: Runtime Error

Solution code:
import math
import sympy


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

    dp = [0] * (n+1)
    dp[0] = 0
    dp[1] = 0
    for i in range(2, n+1):
        dp[i] = dp[i-1] + sympy.divisor_count(i-1)

    print(dp[-1])


if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from sympy import isprime
n = int(input())
lst_c = []
for c in range(1,n): #c != n
    lst_c.append(n-c)

for i in range(len(lst_c)):
    if isprime(lst_c[i]):
        lst_c[i] = 1

#print(lst_c)

cnt = 0
cnt2 = 0
for i in range(len(lst_c)):
    if lst_c[i] != 1:
        for j in range(1,int(lst_c[i]**0.5)+1):
            if lst_c[i]%j ==0:
                cnt += 1
                if lst_c[i]/j == j:
                    cnt2 +=1
                    #print("yes")
        lst_c[i] = cnt
        cnt = 0
        #cnt2 = 0


print(sum(lst_c)*2-cnt2-1)
#print(lst_c)

Submission status: Runtime Error

Solution code:
import sympy
N=int(input())
s=0
for i in range(N-1,0,-1):
    s+=sympy.divisor_count(i)
print(s)

Submission status: Runtime Error

Solution code:
import sympy

n = int(input())

cnt = 0
for i in range(n-1):
    cnt += sympy.divisor_count(i+1)
            
print(cnt)

Submission status: Runtime Error

Solution code:
import sys,math
sys.setrecursionlimit(10**9+7)
n=int(input())
def A(a,count):
	if a>n:
		print(count)
	elif n%a==0:
		A(a+1,count+int(n//a)-1)
	else:
		A(a+1,count+int(n//a))
A(1,0)

Submission status: Runtime Error

Solution code:
import sympy
N=int(input())
num=0
for c in range(1,N):
    num+=len(sympy.divisors(N-c))
print(num)

Submission status: Runtime Error

Solution code:
import math

N = int(input())

ans = 0
for A in range(1, N):
    for B in range(1, N):
        if A >= math.sqrt(N) and B >= math.sqrt(N):
            ans2 = ans + 1 - A*B
            print(ans + ans2)
            sys.exit()

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

Submission status: Runtime Error

Solution code:
import sys,math
sys.setrecursionlimit(10**9+7)
n=int(input())
def A(a,count):
	if a>n:
		print(count)
	elif n%a==0:
		A(a+1,count+(n//a)-1)
	else:
		A(a+1,count+n//a)
A(1,0)

Submission status: Runtime Error

Solution code:
import sympy

N = int(input())

output = 0

for i in range(1, N):
    count = sympy.divisor_count(i)
    output += count
    
print(output)

Submission status: Runtime Error

Solution code:
import sympy
N=int(input())
s=0
for i in range(N-1,0,-1):
    s+=sympy.divisors(i)
print(s)

Submission status: Runtime Error

Solution code:
import sympy
N = int(input())
counter = 0
for i in range(1,N):
    AB = N - i
    counter += len(sympy.divisors(AB))
print(counter)

Submission status: Runtime Error

Solution code:
import sympy

N = int(input())

count = 0
for j in range(N-2):
    count +=len(sympy.divisors(j+2))
    
print(count+1)

Submission status: Runtime Error

Solution code:
import sympy
N=int(input())
count=0
for C in range(1,N):
    A=sympy.divisor_count(N-C)
    count=count+A
print(count)

Submission status: Runtime Error

Solution code:
n = int(input())

cnt = 0
for r in range(1, n):
    for a in range(1, (a // 2) +1):
        if r % a == 0:
            cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
import sympy
N = int(input())
count = 0
for C in range(1, N):
    AB = N - C
    count = count + len(sympy.divisors(AB))
print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
count = 0
for X in range(N):
    for i in range(1, int(X**0.5)+1):
        if X % i == 0:
            count += 1
            if i != X // i:
                count += 1
  print(count)

Submission status: Runtime Error

Solution code:
N=int(input())

while N>=1:
  u=0
  y=0
  for A in range(1,round(N**0.5)):
    if N%A==0:
      if N**0.5==A:
        y=1
        u=u+1
        N=N-1
      else:
        u=u+1
        N=N-1
    else:
       N=N-1
if y==1:
  print(2u-1)
else:
  print(2u)

Submission status: Runtime Error

Solution code:
import math
n = int(input())
c = 3
ans = 0
a = [0 for i in range(n-2)]
d = [0 for i in range(n+1)]
d[1] = 1
for i in range(2,n+1):
    for j in range(2,i):
        if i%j==0:
            if j*j == i:
                d[i] = d[j]*2 - 1
            else:
                if (i/j)%j == 0:
                    d[i] = d[j]*d[int(i/j)]-d[j]
                else:
                    d[i] = d[j]*d[int(i/j)]
            break
    if d[i] == 0:
        d[i] = 2
a[0] = 3
for i in range(1,len(a)):
    a[i] = d[c]+a[i-1]
    c+=1
print(a)
print(d)
print(a[-1])

Submission status: Runtime Error

Solution code:
import sympy
_a =int( input())
_count=0

for i in range(_a):
    _count+=len(sympy.divisors(i))
print(_count)

Submission status: Runtime Error

Solution code:
N=int(input())
count=0
def search_divisor_num_1(num):
    if num < 0:
        return None
    elif num == 1:
        return 1
    else:
        num_sqrt = math.floor(math.sqrt(num))
        prime_list = make_prime_list_2(num_sqrt)

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

        if num != 1:
            divisor_num *= 2

        return divisor_num
for k in range(1,N):
    count=count+search_divisor_num_1(k)
print(count)

Submission status: Runtime Error

Solution code:
n = int(input())
import sympy
count = 0
for i in range(0, n-2):
    n = n - i
    ni = sympy.divisors(n)
    print(ni)
    count += len(ni)
print(count+1)

Submission status: Runtime Error

Solution code:
import sympy

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


n = int(input(''))
result=0
for c in range(1,n):
    n2 = n-c
#    div = divisor(n2)
#    print("{}->{}".format(n2,div))
    fact = sympy.divisors(n2)
#    print(fact)
    result+=len(fact)

print(result)

Submission status: Runtime Error

Solution code:
A, B, C, N = int(input())
N = A * B + C
print(N)

Submission status: Runtime Error

Solution code:
# from pprint import pprint
# import math
# import collections
import sympy

N = int(input())
# N = 1000000
# N = 3

# n, k = map(int, input().split(' '))
# a = list(map(int, input().split(' ')))

yaku_kosu = [1] * N

for ab in range(1, N):
    if ab > 1:
        yaku_kosu[ab] += 1

        j = 2
        while ab * j < N:
            yaku_kosu[ab * j] += 1
            j += 1

print(sum(yaku_kosu) - 1)

Submission status: Runtime Error

Solution code:
N=int(input())
def prod_comb(n):
    A=list()
    c=0
    for i in range(1,n+1):
        a=int(n/i)
        for j in range(1,a+1):
            A.append(int(i*j))
    for s in A:
        if s==n:
            c+=1
    return c
def B(n):
    if n>=2:
        return B(n-1)+prod_comb(n-1)
        
    if n==1:
        return 0
print(B(N))

Submission status: Runtime Error

Solution code:
import sympy
n=int(input())
count = 0
for i in range(1,n):
    l = len(sympy.divisors(i))
    if l%2==1:
        count+=1+(l//2)*2
    else:
        count+=l

print(count)

Submission status: Runtime Error

Solution code:
import sympy

N = int(input())

ans = 1
for i in range(2, N):
    ans += len(sympy.divisors(i))

print(ans)

Submission status: Runtime Error

Solution code:
a=int(input())
b=0
for i in range(a):
  for k in range(i):
    if i%k==0:
      b=b+1
print(b)

Submission status: Runtime Error

Solution code:
S=list(map(int,input().split()))
a=[S[1]]
for i in range(0,S[0]-1):
        if a[i]**2>10**9+7:
           a.append(((a[i]**2)%(10**9+7))%S[2])
        else:
           a.append(((a[i]**2)%S[2])
print(sum(a))

Submission status: Runtime Error

Solution code:
import sympy
n=int(input())
count = 0
for i in range(1,n):
    l = len(sympy.divisors(i))
    if l%2==1:
        count+=1+(l//2)*2
    else:
        count+=l

print(count)

Submission status: Runtime Error

Solution code:
S=list(map(int,input().split()))
a=[S[1]]
for i in range(0,S[0]-1):
        a.append(((a[i]**2)%(10**9+7))%S[2])
print(sum(a))

Submission status: Runtime Error

Solution code:
if N < 100:
    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
else:
    for i in range(1,N):
        for j in range(1,N//i):
           c = N - i*j
           if 1 <= c <= 1000000:
               count += 1 
print(count)