QOJ.ac

QOJ

Limite de temps : 1.0 s Limite de mémoire : 32 MB Points totaux : 30

#17121. PASCAL

Statistiques

小 Frane 已经上十年级了,但依然在微机课上为 Pascal 语言发愁。作为家庭作业,他的老师在他的笔记本上写下了以下程序,他需要根据给定的整数 $N$ 确定程序的输出。

readln(N); 
counter := 0; 
for i := N-1 downto 1 do begin 
 counter := counter + 1; 
 if N mod i = 0 then break; 
end; 
writeln(counter);

请编写一个程序来解决 Frane 的问题。

输入格式

输入的第一行包含整数 $N$ ($1 \le N \le 10^9$)。

输出格式

在单行中输出结果。

样例

输入样例 1

1

输出样例 1

0

输入样例 2

10

输出样例 2

5

输入样例 3

27

输出样例 3

18

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.