Mayan Calculation puzzle discussion

If some of the poeple who solved the problem with the ‘Base20’-Validationtest would post their solution or maybe where the problem was, that would be nice.
I got the same issue. All tests and all validations are working fine and fast but only the ‘Base20’ seems to have a problem.

With kind regards

Which kind of issue do you have? You fail at giving the right number? You got an error? How does your output looks like?

It says nothing special. And i am very sure i did not hardcode anything.

I had the same issue using Java, so I looked up the max value for an int. Using longs instead of ints for my operands solved it.

Since I am using Python, this wont work for me. But thanks for the response.

Same here. I’m going to see if it’s different when run under Python3

I still fail base20 on the validation with Python3; it passes on the examples.

Nothing in my solution’s hard-coded, it could be a rounding error on Pythons part. I’ve seen it happen before when you’re working with very very large ints that Python will round.

I’m almost certain that my code is ‘correct’. I might try taking a stab at it with C++ and see where that gets me.

Hello, i have the same problem. All green except the Base20 validator, and impossible to debug since it’s in… validators.
I use long for operands & results.

It would be nice, if someone fixed it, to share the trick. :slightly_smiling:

Hello I’m very frustrated, there seems to be a problem with C#. I’m pretty sure that some inputs are wrong. In te test “substraction” for example, the first value given is a 6 and a 3, but looking for C solutions, the numbers 6 and 9 are given. And the same with other tests. Can someone verify that at least? so I can sleep tonight…

I get the same inputs for C and C# for num1Line : 6 and 3.

you are right. I was confused. I have just figured out my problem. thanks for the fast reply!

Has anyone solved the “Great multiplication” issue? When using the error log I get the result of 1 billion and when calculating the product with calculator i get 9 billion, also using unsigned long [long] int in c++ doesn’t help
-------EDIT-------
after some googling, I realised, that my function type is INT, but one of the numbers is actaully larger than INT, so it worked when I changed return type to LONG INT

1 Like

Having the same prob, base 20 validation only

Those of you having problems with the big multiplication are likely missing zeros (inside or to the right) in the conversion - do the math manually on your output and you’ll likely find the math doesn’t add up.

Would be nice to know whats different about the validations… usually I find some bug (fix) that the normal tests don’t cover fixes it.

if your testing if its >19 during your conversion, try changing to >20 - worked for me (not sure why it doesn’t break lol, just tried it for kicks)

1 Like

Hi. I am trying to solve this puzzle with a 100% score. However, I can not finish “BASE 20” section. Therefore, I checked input condition. The result is as follows.

// information about mayan numeral
L: 1 H :1
0123456789ABCDEFGHIJ

// information about value_1
S1: 4
num1Lines:
1
0
0
G

// information about value_2
S2: 2
num2Lines:
2
2

Does it means that “0” - “J” are regarded as 0 - 19 and my code have to process mayan numeral with this style as if the code processed mayan numeral with the style using “o”, “.” and “-” ??

With regards,

There seems to be an issue with using files as storage in bash.

So in bash, I tried dumping out the block representing a number to a file name “0”, “1”, “2”,… and so on with the pattern in them. I used that set to compare the input to by just diffing the incoming with the set of patterns i had stored. This worked all well and dandy during the test cases.

However, on submit this failed. I thought it might be an issue where they were getting ran parallel and so the files were conflicting, so I used the process id of the script to make sure that wasn’t the case. This did not help.

As a final test, i just stored them internally into memory as one long string, and it worked fine. I didn’t have to change any base calculations being performed. So to me, it appears that this is a bug with using files. I’m mainly just curious what is failing on submit and why.

It could just be that codingame doesn’t like me writing a bunch of files, but it didn’t seem to be an issue during the test cases.

Wow that really worked (I changed it from 20 to 21), any idea why it works now? I feel so confused…

I dont understand the “missing power” test. Some one explain please.

Like in 102.

Could you please be more specific…

Or in A40F01 in hexa.