Mayan Calculation puzzle discussion


#66

Basically, if I do it by hand the result I get after analysing the input seems to be correct (but different from the one accepted by the site)
Yes, I do believe I am using long in every place that I should (all the other tests pass, this is the only one failing :confused: )


#67

I must be dense but I can’t find my error on the Base20 test.
My results are:
2// (20 ^ 4 ) * 2 =====> 320 000
0// (20 ^ 3 ) * 0 =====> 0
1// (20 ^ 2 ) * 1 =====> 400
C// (20 ^ 1 ) *12 =====> 240
0// (20 ^ 0 ) * 0 =====> 0

Which yields the right total (320 640). Yet I get the error:
Failure
Found: 0
Expected: 2

What obvious thing am I missing?!?


#68

Not sure how you get your figures? The test case should be:
100G x 22 (base 20) = 8016 x 42 (base 10) = 336672 (base 10) = 221DC (base 20)


#69

Argggggghhhhhhh… I knew it had to be something stupid. I was looking at my output but it was in fact my input that was wrong. In an effort to “optimize”, I did some bad cut&pasting which resulted in my arguments being read as (8016 x 40), in decimal. As if I didn’t know you should never optimize until all test cases have been successful… geeeeezzzz…

Thanks for helping me find this!


#70

In my Python code, I get a problem with the validation on Base 20. It doesn’t look like I can debug it, so I have no idea why I get that…


#71

seems you managed to solve it after all. Please think about editing your post, either to remove it or tell what was wrong in your algorithm. Thanks!


#72

I was having the same problem with the base_20 test as Myself1 then I realized i messed up the exponents.