Task DescriptionDiscussion (0)
Task :: Wooden doors
Little-Z has N closed wooden doors (numbered from 1 to N), and N people.

The first man opens every door. So then, all doors are in opened state. The second man changes the state (opens, if closed and closes, if opened) of every second door. The third man changes the state of every third door, the fourth man changes the state of every fourth door and so on...

At the end, when all people do their pass, some of the doors remain opened.

Since this task is very time-consuming to do it in real time, they gave you you a computer to predict a number of opened doors.

In first line, there will be a number 1 <= N <= 2^60, representing the number of people and doors. For first 5 test cases it wil be true: 1 <= N <= 2^30.

Output one number, representing the number of opened doors after all N people have done their pass on N wooden doors.


Submit Solution
Available Languages
Task info
Name:Wooden doors
Time:0.05 sec.
Memory:4 MB
AddedBy: s-lime
Source:Rok Kralj
Task Ratings

3.6 (31 votes)

4.3 (30 votes)
Acceptance Rate
Recent Submissions
Fastest Solutions
palmeida 0 s.
nikola 0 s.
Nikola94 0 s.
Al3kSaNdaR 0 s.
hadzem 0 s.
xhizors 0 s.
Delta3 0 s.
Lazar_94_kg 0 s.
alex_mat 0 s.
matijazzz 0 s.
Solved By