Feel free to send your feedback or ask some help here!
Just a quick feedback on āthe Giftā: I had the feeling that it was significantly easier than the other medium puzzles. It is often difficult to determine how ātrivialā an algorithm is, because it is a matter of experience, training, or just luck to find the ārightā way on the first attempt. Yet, for this one, the first thing that came to my mind (sort and print minimal budgets until the rest can be shared among large budgets) happened to be a 10 minute / 20 lines of C++ code / 100% solution. Does the order of puzzles is meaningful? If yes, this one might be moved among the first ones.
I concur. I found it really easy and had it working in like 5mn, although I used a completely different approach (from smallest to largest, always assign the remaining mean, or as much as possible).
I pass all tests (even the test Impossible) but when I submit my code the test Impossible does not pass. I donāt understand why.
The exact same thing happened to me maybe the test Impossible is not exactly the same when we submit our codeā¦
Continuing the discussion from [Doctor Who - The Gift puzzle discussion]
EDIT: nope, talk about the puzzle in the appropriate puzzle topic, donāt create an unnecessary long title either please
Hi,
System tests are not the same tests as presented to avoid hard coding of solutions.
If your code not pass a test, your code is not optimized for all situations ālikeā the situation tested.
Try to optimize your code.
I had the same problem with the TEADS problem.
In fact, my solution was buggy. I edited it, now itās 100% validated.
NO DAMN FULL CODE
here is my solution.can some1 tell me what is the problem here
O_o
Your solution is far more complicated than mine.
i got strange bug here: my code did not pass test #8 āSeveral solution fastā from ide window, but 100% tests are completed on submit somehow
checking my codeā¦
yep - after some rewrites i passed all tests before submit, but i think there should be achievment for this
seriously, if you have different validation tests before submission and after it - you should expect reverse results sometimes
Why my solution passes all test exept ābig randomā?
Edited: No full code even in png
i suppose this is due to rounding / division errors, no need to use division in this task:
Edit : No full Code
Potential error with Test Case 3.
Input provided by automated test case is 1, 100, 60, with result 1, 49, 50. I think there is a typo with 60 and it should read as 100.
Thoughts?
The input I am seeing is
3
100
100
1
60.
I got all of the tests running except the last one āBig Randomā. When writing debugging system prints, Iām learning that the program is cutting off a part of my ArrayList (implemented with Java). I would store all of the 85614 numbers in an ArrayList to work with. Printing out this ArrayList shows the number fine, but immediately printing this list again, without any other code in between will list only a handful of numbers, all in the [160;164] interval. So essentially, it cut off a huge part of the list from the beginning and only saved about 30 or so at the tail. Iām assuming Iām working with memory constraints here then?
I find it weird it would store the values in my ArrayList fine and show them correctly when I print them the first time, but upon printing them out again immediately, it would return a shortened version.
Changing them into an array worked fine. Weird.
Why by input :
3
100
100
1
60
the system expects :
1
49
50
I think the result should be :
39
1
60
?
So, yeah, I also built a way to do it very quickly, but I got a very strange bug with the last testcase ābig randomā. At some point, where the participants were spending 70, one of them spent 69 (based on my calculations). I couldnāt find a way to get an idea of what was going on, so I applied a patch so ugly my own momma would slap me silly:
if( uCurrentSpending < uLastCurrentSpend )
{
uCurrentSpending = uLastCurrentSpend;
}
Now itās eating me aliveā¦
IIRC, I found the ceiling function useful. Or the floor. One or the other.