ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1132. Square Root

Show all messages Hide all messages

We should print "2 15 19" (maybe something else), but in
sample we have only 2 15. Why?
the text is not clear ! Dinh Quang Hiep (mg9h@yahoo.com) 4 Nov 2001 21:35
if 19 appears, so 32 must do the same.
In this prob, we must understand to output all the X
satisfy the rule AND X <= N, that what i think about it :)

QH@
Re: the text is not clear ! Michael Medvedev (KNU training center) 5 Nov 2001 13:39
> if 19 appears, so 32 must do the same.
> In this prob, we must understand to output all the X
> satisfy the rule AND X <= N, that what i think about it :)
>
> QH@
>
>

sqroot(a,n) is less then n. Remember that the result of
modulo operations are always less than modulo!!!

So sqroot(4,17) are less than 17 and of course, are
positive integers.

Author.
yes, but in the text u defined a new operation ..... (+) Dinh Quang Hiep (mg9h@yahoo.com) 5 Nov 2001 14:43
"The number x is called a square root a modulo n (root
(a,n)) if
x*x = a (mod n)"
so it's free to think that X can be in any range it wants !
So must put more rules that X <= N :-)

QH@
Fixed Marat Bakirov 5 Nov 2001 19:21