Ad
  • Custom User Avatar

    yea i am a novice and i understand this but takes a while before i know how the top one works

  • Custom User Avatar
  • Custom User Avatar

    It's highly unlikely that you will get anywhere if you do not use some very specific number theory theorem. I think you just need to do some more research, until you stumple upon some particular approach.

  • Custom User Avatar

    I am hitting timeout exception with n=661915703. I have tried solving the problem using DP + memoization and BFS. Both the solution are encountering same timeout issue. I am unable to identify whats wrong. Any pointers will be great.

    Thanks.

  • Custom User Avatar

    it's most probably a bug in c++ version of the kata. please check if adding include <cmath> in your solution helps, even if you don't use it.

  • Custom User Avatar

    What are these errors? I don't have these on my file. (C++)

    In file included from main.cpp:7:
    ./tests.cpp:7:35: error: no member named 'sqrt' in namespace 'std'
    return n == std::pow(int(std::sqrt(n)), 2);
    ~~~~~^
    ./tests.cpp:7:22: error: no member named 'pow' in namespace 'std'
    return n == std::pow(int(std::sqrt(n)), 2);
    ~~~~~^
    ./tests.cpp:20:27: error: no member named 'sqrt' in namespace 'std'
    int sqrt_n = int(std::sqrt(n));
    ~~~~~^
    3 errors generated.

  • Custom User Avatar

    "I don't understand the guy, so I am going to throw some curse words at him." - yup, sounds perfectly reasonable.

  • Custom User Avatar

    i don't understand why he writes it here

  • Custom User Avatar

    why so salty? xD

  • Custom User Avatar

    damn you even coded longer than me

  • Custom User Avatar

    For those of you using C++ AND CAN ONLY PASS THE FIRST ONE IN THE ATTEMPT, when you are using vector array, try it in visual studio first, make a for loop of 10, loop your code and then you will see that you will only get the 1-3 correct results(most of them are repeated).

    OK, put your functions into a class, seperate each executions into objects so that they will not clash into each others.

    This is what I have found, I am not good at it, but have fun anyway.