Ad
  • Default User Avatar

    @hobovsky
    I have defined that operator for my type and it still does not work.

    Edit: it did not work because I had other mistakes in my code (mainly to do with const qualifiers of functions). Once my code started working I removed the operator<< definition and started getting errors connected it. Thank you for the suggestion.

  • Custom User Avatar

    You need to define operator << for your type. Otherwise, testing framework cannot stringify it to build an assertion message.

  • Custom User Avatar

    The same problem. My solution works locally using Cygwin Clang 8.0.1 but raises a similar error here.

  • Custom User Avatar

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

  • Custom User Avatar

    Thanks. My algorithm was ok, but I used int as initial value in std::accumulate() insted of 1ull - unsigned long long.

  • Custom User Avatar

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

  • Custom User Avatar

    1170050802 / 5262 is not an integer (and 27115 / 5262 isn't reducible) , so that can't be the lcm.

  • Custom User Avatar

    Hello,
    I went through all the tests, but I got stuck in one.
    (27115,5262)(87546,11111111)(43216,255689)

    Expected: equal to (77033412951888085,14949283383840498)(117787497858828,14949283383840498)(2526695441399712,14949283383840498) Actual: (6029237170,1170050802)(9192330,1170050802)(197756416,1170050802)

    I tried using my solution and also c++ std::lcm() to calculate and still got the same lcm = 1170050802 not 14949283383840498 like in the test.
    Can someone please help me understand this result?