Ad
  • Custom User Avatar

    Clever problem!

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Updated with a proper solution, tested against the unoptimized brute force solution in thousands of cases (which I really should have done from the beginning). Marking as resolved, but please let me know if you run into issues. Also gonna go through and mark most of this as spoilers...

  • Custom User Avatar

    I removed the final example test. There are 50 random tests; I'll reduce that number later tonight.

  • Custom User Avatar

    For now I've changed the test to allow scores better than expected. Still working on a proper solution.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    I'll spend the next couple hours trying to come up with something genius, but it might be the case that brute force is the only way to go... could that really be true? Even within brute force, maybe there are optimizations that can bring the time down. If not, I may just have to reduce the complexity of the test cases.

    I'll keep an eye on this thread if others want to chime in.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    The goal is to find the global maximum; you're doing it right. I actually wasn't aware that the greedy approach could find local maxima... I'll debug once I get home and let you know when it's ready to submit.

  • Custom User Avatar

    If the test case is reporting your score as higher than expected, there's probably a bug in the test. Let me investigate...

  • Custom User Avatar

    I'll expand that part and bold it to draw more attention. Thanks for the input!

  • Custom User Avatar

    I personally find some of the results quite counterintuitive. :)

    Totally understandable. I was hesitant to include multi-trick examples in the description because it felt like it was already getting long, but maybe I'd be better off going a little more in-depth? You've written and solved a lot more of these than me, so I'd take any suggestions I could get.

  • Custom User Avatar

    All good. Were the instructions unclear, or was it just the general counterintuitiveness of the problem?

  • Custom User Avatar

    What are you expecting the answer to be? Running the calculation for some answers yields:

    {'kickflip': 8 }
    .95^8 * (100 * .8^0 + 100 * .8^1 + 100 * .8^2 + 100 * .8^3 + 100 * .8^4 + 100 * .8^5 + 100 * .8^6 + 100 * .8^7) = 276.05847627178235

    {'kickflip': 7, 'heelflip': 1 }
    .95^8 * (100 * .8^0 + 100 * .8^1 + 100 * .8^2 + 100 * .8^3 + 100 * .8^4 + 100 * .8^5 + 100 * .8^6 + 101 * .25^ 0) = 329.1510049887904

    {'kickflip': 8, 'heelflip': 1 }
    .95^9 * (100 * .8^0 + 100 * .8^1 + 100 * .8^2 + 100 * .8^3 + 100 * .8^4 + 100 * .8^5 + 100 * .8^6 + 100 * .8^7 + 101 * .25^ 0) = 325.9107428403787

    So the expected answer seems to be the optimal one.

  • Custom User Avatar

    Thanks for the heads up! Taking a look...

  • Loading more items...