Skip to main content
25 events
when toggle format what by license comment
Apr 13, 2017 at 12:50 history edited CommunityBot
replaced http://puzzling.stackexchange.com/ with https://puzzling.stackexchange.com/
Oct 22, 2014 at 14:57 vote accept CommunityBot
Oct 16, 2014 at 11:51 answer added Gerwin timeline score: 3
Oct 14, 2014 at 15:26 answer added Alchymist timeline score: 1
Oct 13, 2014 at 22:49 answer added TwiN timeline score: 1
Oct 13, 2014 at 17:37 comment added R.T. This question got me thinking. If we take the two numbers as base-101 integers and combine them (refund*101 + tax), we can get a unique number per input case. Then, once we already know the right answer per input case, all we have to do is find a hash function that maps each input to the correct output. I wrote a C program to try to brute-force find such a hash, but it was not a very sophisticated attempt. Has anyone tried to search for a hash function that fits given input->output sets? I could not find any best-practices or tips for doing this.
Oct 13, 2014 at 15:07 comment added user21677 @TwiNight there's a rounding issue. Since there's a fraction of a cake, it's rounded in the troll's favor. From your examples, it's give 3 receive 2 and give 2 receive 1.
Oct 13, 2014 at 15:05 comment added user21677 @Dennis clarified troll didn't get to keep cake; fixed in edit.
Oct 13, 2014 at 15:03 history edited user21677 CC BY-SA 3.0
deleted 3 characters in body
Oct 13, 2014 at 8:46 comment added TwiN There are conflicts in the spec. In the 25 2 11 cake case, you give the troll 2.75 cakes and get back 2 so the troll keeps .75(+.25) and you survive. In the 90 1 2 cake case, you give the troll 1.8 and get back 1 so the troll keeps .8(+.2) but you die.
Oct 13, 2014 at 2:07 answer added marinus timeline score: 4
Oct 12, 2014 at 22:07 answer added Dennis timeline score: 2
Oct 12, 2014 at 19:29 comment added Dennis Rule 2 seems to exclude the possibility of a troll receiving only a fraction of a cake, which should make assumption 4 redundant. Yet you say in example 2 that the third troll would only get 0.8 cakes.
Oct 11, 2014 at 2:04 answer added user10766 timeline score: 2
Oct 10, 2014 at 22:04 history tweeted twitter.com/#!/StackCodeGolf/status/520696509198008321
Oct 10, 2014 at 20:20 history edited user21677 CC BY-SA 3.0
data
Oct 10, 2014 at 18:54 answer added Optimizer timeline score: 5
Oct 10, 2014 at 18:36 comment added user21677 bah, this is why c# can't have nice things
Oct 10, 2014 at 18:34 history edited user21677 CC BY-SA 3.0
nevermind my #include statement
Oct 10, 2014 at 18:31 answer added Martin Ender timeline score: 6
Oct 10, 2014 at 18:28 comment added user16402 This is a good puzzle to brute-force in CJam. I'll do that around tomorrow
Oct 10, 2014 at 18:21 history edited user21677 CC BY-SA 3.0
#include
Oct 10, 2014 at 18:15 history edited user21677 CC BY-SA 3.0
input
Oct 10, 2014 at 18:13 comment added user21677 Good point. Make it a complete program for simplicity. Input can be specified however you see fit as long as it's not hard-coded (updated challenge).
Oct 10, 2014 at 18:03 history asked user21677 CC BY-SA 3.0