I refer to the Constraints section:
0 < L, H < 100
0 < S1, S2 < 1000
The remainder of a division is always 0.
The mayan numbers given as input will not exceed 2**63.
I refer to the Constraints section:
0 < L, H < 100
0 < S1, S2 < 1000
The remainder of a division is always 0.
The mayan numbers given as input will not exceed 2**63.
I realy enjoyed it when solving.
I donât know what is happening. I was able so solve the puzzle and have 100% however when I tried submit the results they werenât loading so I tried to refresh and go backwards and it appears that I have 0% progress and now Iâm afraid I lost everything.
I had an issue with the test âBase20â.
The problem I was facing was not because I was not reading all of values from the dictionary.
The issue was in the conversion from base 20 to base 10:
Instead of starting doing a multiplication with 20^(0âŚn), I was doing it with 20^(1âŚ(n-1))
I want to emphasize that all other tests where passing but that one.
I hope it can help
I donât understand how we find the power of 20 ???
RE: Base20 validation case issue: Perhaps this was already addressed, but in case it wasntâŚ
I was was struggling with this for a bit⌠I realized that I wasnât building the 20th index into my dictionary (< vs <= issue). It seems like the unique aspect here is that this the only test to actually indexes the 20th numeral.
I seem to have a completely different issue. Iâm using C++ and Iâve tried multiple lengths of integer all the way up to unsigned long long, and yet when I multiply the numbers on one of the tests,
I get:
12345 * 789012 = 1150418548
When it should be:
12345 * 789012 = 9740353140
Any ideas?
Perhaps you havenât declared the product variable as unsigned long long? I got 1150418548 from the code below:
#include <iostream>
using namespace std;
int main() {
unsigned long long a, b;
a = 12345;
b = 789012;
unsigned int c; // should be unsigned long long
c = a * b;
cout << c << endl;
}
I get that same answer with a standard int as well. But like I mentioned, changing it to a long long (unsigned or not) seems to yield the same result.
Did you try running the above code with the commented line changed to:
unsigned long long c; // should be unsigned long long
? It works for me.
If it doesnât work for you for some reason, there must be a bug elsewhere in your code.
I found the issue. In the above example, all 3 variables were long long. In mine, C was long long, but a & b were still int - apparently, even though a & b were within the limits of int, they couldnât multiply high enough before storing in c.
In this example Input section, 10 is incorrect.
I tried solving this in Rust, but Iâve encountered an issue.
The symbol to be decoded does not match any of the provided Maya symbols.
For example, in the second test âAddition with carryâ (H=4 and L=4), I have the following Maya symbols:
SYMBOL 0
'.oo.'
'o..o'
'.oo.'
'....'
SYMBOL 1
'oo.o'
'..o.'
'oo..'
'....'
SYMBOL 2
'o.o.'
'.o..'
'o...'
'....'
SYMBOL 3
'.o..'
'o...'
'....'
'....'
SYMBOL 4
'o...'
'....'
'....'
'....'
SYMBOL 5
'...o'
'....'
'....'
'....'
SYMBOL 6
'..oo'
'....'
'....'
'....'
SYMBOL 7
'.oo.'
'....'
'....'
'....'
SYMBOL 8
'oo..'
'....'
'....'
'....'
SYMBOL 9
'o..o'
'....'
'....'
'....'
SYMBOL 10
'..oo'
'....'
'....'
'....'
SYMBOL 11
'.ooo'
'....'
'....'
'....'
SYMBOL 12
'ooo.'
'....'
'....'
'....'
SYMBOL 13
'oo.o'
'....'
'....'
'....'
SYMBOL 14
'o.oo'
'....'
'....'
'....'
SYMBOL 15
'.ooo'
'....'
'....'
'....'
SYMBOL 16
'oooo'
'....'
'....'
'....'
SYMBOL 17
'ooo.'
'..._'
'....'
'....'
SYMBOL 18
'oo..'
'..__'
'....'
'....'
SYMBOL 19
'o...'
'.___'
'....'
'....'
And S1 is provided as:
S1, number of lines : 4
line 0 is 'ooo.'
line 1 is '____'
line 2 is '____'
line 3 is '____'
I suspect the dictionary being used is just the default one from the problem description.
Furthermore, the expected result for the second test is 84 (4 times 20^1 + 4 times 20^0).
This suggests the operator provided is also incorrect. The input read is "+", but if S1 and S2 each consist of only one Maya digit, the maximum sum possible is 38 (19 + 19).
It seems like the test should actually be:
S1 = 7 (currently not found)
S2 = 12 (matches Maya symbol 12)
Operator: â*â (instead of â+â)
Refer to the input; it seems that youâve extracted the wrong symbols:
.oo.o...oo..ooo.oooo....o...oo..ooo.oooo....o...oo..ooo.oooo....o...oo..ooo.oooo
o..o................____________________________________________________________
.oo.....................................________________________________________
............................................................____________________
I hadnât considered that possibility. I will double-check that section. Thank you."