Donate to us via Paypal!
The measure of a mans life is not how well he dies, but how well he lives.
Wednesday, September 30, 2020
Navigation
Home
 Find:
 Information:
Learn
Communicate
Submit
Shop
Challenges
 Exploit:
 Programming:
 Think:
 Track:
 Patch:
 Other:
 Need Help?
Other
Members Online
Total Online: 65
Guests Online: 65
Members Online: 0

Registered Members: 128866
Newest Member: noid_
Latest Articles

View Thread

HellBound Hackers | HellBound Hackers | Bugs

Author

Timed 10: Why Four Numbers


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 04-01-11 22:11
Timed 10 asks for the greatest common divisor of four integers. However, the GCD between any two of the given numbers is the GCD between all four. I can only assume this was unintentional because giving four numbers instead of two is merely a waste.

In order to force users to use more than their built in GCD library function (or the whole 5 lines, max, it takes to implement one) I would suggest having the GCD between the four numbers be different than the GCD amongst any two of the numbers. Thus, having the users think slightly beyond using predefined functions.




Edited by rex_mundi on 25-03-13 19:13
Author

RE: Timed 10: Why Four Numbers?

ynori7
Member



Posts: 1486
Location: #valhalla
Joined: 08.10.07
Rank:
God
Posted on 04-01-11 22:46
Vty wrote:
Timed 10 asks for the greatest common divisor of four integers. However, the GCD between any two of the given numbers is the GCD between all four.

gcd(16, 24) = 8
gcd(16, 24, 36) = 4
gcd(16, 24, 36, 42) = 2

EDIT: Oh, I see you were referring to just the particular numbers given in the challenge, not in general. Well here are the numbers that were just generated by the challenge when I loaded it: 1660 6391 3984 8134
gcd(1660, 6391) = 83
gcd(1660, 8134) = 166
gcd(1660, 3984) = 332
gcd(8134, 6391) = 581




Check out my novel, A Fatal Exception. And find more about it at my author page


Also check out:
IT Community and Hacking Challenge Site: Halls of Valhalla
IP Checker: IP Info

Edited by ynori7 on 04-01-11 22:54
ynori7 http://halls-of-valhalla.org
Author

RE: Timed 10: Why Four Numbers?


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 04-01-11 23:16
Hmm, yes I see. Well I'm glad that's the case. I just tested it again and now after the third set I've seen, it was different for one set of numbers. It works as intended then - even though it could be a bit more random.

EDIT: I see you can simply pass more parameters to your built in GCD functions anyway. Shucks.




Edited by on 04-01-11 23:18
Author

RE: Timed 10: Why Four Numbers?

ynori7
Member



Posts: 1486
Location: #valhalla
Joined: 08.10.07
Rank:
God
Posted on 04-01-11 23:34
Vty wrote:
EDIT: I see you can simply pass more parameters to your built in GCD functions anyway. Shucks.

That probably depends on the language. I wrote my own gcd function that accepts multiple parameters.



Check out my novel, A Fatal Exception. And find more about it at my author page


Also check out:
IT Community and Hacking Challenge Site: Halls of Valhalla
IP Checker: IP Info
ynori7 http://halls-of-valhalla.org
Author

RE: Timed 10: Why Four Numbers?


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 05-01-11 02:04
Fair enough. I see a lot of the libraries for dealing with variable length numbers will do the same as well. Take BigInt in Perl for example.


Author

RE: Timed 10: Why Four Numbers?

ADIGA
Member



Posts: 57
Location: Jordan - Middle East
Joined: 28.12.07
Rank:
Hacker Level 1
Posted on 05-01-11 20:06
is there a function in php for that!!!
lol, did not know that!
adiga_php@hotmail.com adiga.hacker@yahoo.com www.adiga.ws