Ad
  • Default User Avatar

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

  • 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

    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.

  • 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.