Groups
Groups
Sign in
Groups
Groups
Online Judge Helps
Conversations
About
Send feedback
Help
UVA 10042 (Smith Number)
10 views
Skip to first unread message
Atiqur Rahman
unread,
Dec 25, 2008, 11:24:13 AM
12/25/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Online Judge Helps
It's AC. It's one of the easy problems related to Number theory
(Prime)
A theory has helped me much "A number if divided by all its prime
factor upto square root of that number result is one or a prime
number"
As the input range is upto 10^9 I only pre-calculated 40,000 prime
numbers which are required upto the square root.. And that worked
fine.
Some input/outputs in case anyone fails to get AC.
Input
=======
7
1
5
22
31
4937774
4937775
999999999
31601
Output
=======
4
22
27
58
4937775
4937818
1000000165
31639
Reply all
Reply to author
Forward
0 new messages