Ad
  • Default User Avatar

    maybe he use 9.8 because te test is using an iterative algorithm, the problem is stupid

  • Custom User Avatar

    My advice is to stop feeling dissapointed and fork the translation and fix it if you want.

  • Custom User Avatar

    You should not seed anything at all.

    Also, for some reason even a working solution may not pass the tests (I suspect it's the absence of seeding inside the fixture, though I can't tell for sure).

  • Default User Avatar

    Seeding outside the loop. First line of code in the function.

  • Custom User Avatar

    Are you seeding inside or outside the loop? The former will lead to resetting the randomizer with each loop generating identical results each time.

  • Default User Avatar

    Maybe this question can't be answered because it's too revealing, but I must ask anyway.

    Coding in C++, using built-in random function and seeding with time. However, when the tests run, it gives the same password every single time. The password looks random, but it is just the same thing over and over again. Not really sure how to get around this because seeding with the time should solve this problem. Any tips?

  • Default User Avatar

    You have used 9.8 instead of 9.81, that's the only problem with your solution.

  • Default User Avatar

    This is so stupid. Ran tests once and was "off" on one of the random tests (I wasn't off, but the answer was because of rounding).

    Then I ran it again and magically worked because of different random tests.

    Would 10/10 recommend deleting this challenge...waste of time to code correctly and have a coin-flip chance of being correct due to rounding. This is amateur stuff.

  • Custom User Avatar

    Not an issue.

  • Default User Avatar

    USE A LIST INSTEAD OF INDIVIDUAL ARGUMENTS...

  • Default User Avatar

    Ran into issue when "Attempting" in C++ 14:

    main.cpp:34:9: error: use of undeclared identifier 'unordered_set'
    unordered_set s = {1, n};
    ^
    main.cpp:34:28: error: expected '(' for function-style cast or type construction
    unordered_set s = {1, n};
    ~~~~ ^
    main.cpp:38:17: error: use of undeclared identifier 's'
    s.insert(x);
    ^
    main.cpp:39:17: error: use of undeclared identifier 's'
    s.insert(n / x);
    ^
    main.cpp:41:16: error: use of undeclared identifier 's'
    return s.size();
    ^
    5 errors generated.

    Issues seem to be outside my code...not sure there's anything I can do about this. Dissapointing but not necessarily surprising.

  • Default User Avatar

    I agree! Would be a less trivial problem to solve too.