No.1162 Many Quotients hard
Problem Statement
The problem statement is the same as Many Quotients easy, but the constraints are harder.
You are given a positive integer $N$.
Let $N/K$ denote the quotient (an integer) when $N$ is divided by a positive integer $K$. Find how many distinct integers appear among $N/1,N/2,...,N/N$.
Input
$N $
$N$ is an integer.
$1 \leq N \leq 10^{18}$
Output
Output the answer on $1$ line.
Print a newline at the end.
Sample
Sample 1
Input
3
Output
2
The values of $3/1,3/2,3/3$ are $3,1,1$ respectively, so $2$ distinct values appear. Therefore, output $2$.
Sample 2
Input
319
Output
34
Source
Nada High School 75th Class Junior High School Graduation Commemorative Contest: Many Quotients hard
writer: karudano
tester: Mitarushi
Ported in accordance with HackerRank's terms of service. Some parts have been modified.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
蜜蜂