Mayan Calculation puzzle discussion

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: )

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?!?

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)

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!

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…

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!

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

Yes, it does.

Hello,
The code passes all tests. But on final submission, validator #7 fails (division). Since all tests pass, I have a difficult time figuring what validator #7 has that the tests haven’t.
Any help or advice is appreciated.

Never mind. I figured.

var 
  maya1, 
  maya2, 
  maya3,
  maya_haha // sorry

Thanks a lot for the problem, it was harder than expected I liked it a lot :wink:

1 Like

Hello, I’m passing every test but when submitting I’m not passing the “Other Symbols” one. I can’t figure out a non passing test.
Does anyone know if there is something special about this one?

Hello !
Hi have a problem I code in C so I use malloc function. Unfortunatelly, my function have a bug : I use a for to take all the line of my number but with substraction in the for all is good the number num1 is :
o…
----
…
…
But when I go out of the for it changes into :
P?UUUU
----
…
…
Can you help me to solve this problem (all the previous test works so 41%)
Thanks !

Hi, i don’t understand how to convert a negatif number in base 20, i searched and understand for base 2 but i can’t apply it to base 20.
please help me to understand

Why would you want to convert a negative number? Such a case doesn’t seem to be tested in this puzzle.

For the substraction test, my calculation is 0-7=-7 so i have to convert -7 into mayan number

Case 4 (Simple subtraction) is 7-2, and case 5 (Subtraction) is 123-7. There is not a case of 0-7.

Hello,
I have the same problem (pass all tests but the base20 validator is wrong). I’ve checked initial input reading but I don’t find anything, I have the J in my numerals for base20 test :frowning:
So, are there any other ideas because I’ve checked a lot of things and all seems to be good.

Thanks

I don’t have an idea of what the input numbers of that validator is. But the statement has stated the range of input numbers, so you can test them all out offline.

Hmm, what do you mean by “range of input numbers” ? The fact that I have 20 numerals in my input numbers ?