Ad
  • Custom User Avatar
  • Custom User Avatar

    Failed to pass this test:

    ******* 59 *********
    .a = {-2.51671803324,1.30616030283},
    .b = {3.87271832814,-1.91084126197},
    .c = {
    {-0.59711858863,0.881649872754,0.914459906914},
    {-0.962345076259,-4.03892196016,1.30995611332},
    {-4.39527013572,0.598277573008,1.14106745452},
    {-4.04069135198,-3.12177702552,1.03569137848},
    {-4.75431525847,-4.20650289627,0.66865736011},
    {-0.0353969936259,-0.376568927895,1.08103569236},
    {-3.09102221159,3.9586655586,1.38980286361},
    {2.99263592577,1.72149120132,0.850078982138},
    {3.63656748319,0.886315449607,1.25231607005},
    {3.49615606247,2.21439161571,1.2353831067},
    {1.00416972535,-2.31594216311,0.470424721367},
    {0.848565415945,-2.36408579862,0.873430584953},
    {-1.33173195412,-1.14513431909,1.33512805726},
    {2.36933284206,4.22030604677,1.22080219288},
    {2.87690920057,1.33573198458,0.733985557198},
    {2.83323324984,-1.17841666332,0.675529731461},
    {-2.05984547501,3.95228252513,0.900663372944},
    {0.601596075576,-1.76170821069,0.996919863974},
    {0.378448769916,1.05643301969,0.66755388116},
    {-4.80265962193,3.96276660496,0.798043358536},
    {0.228886886034,3.70402431814,1.23521347332},
    {-4.57708235132,0.916903645266,1.20442000937},
    {-3.53017202346,1.16296296706,0.842480887636},
    {-1.25862282002,3.24817231158,0.927702947729},
    {-3.52647561347,-1.43026176142,0.508443075116},
    {-4.64438741328,-3.50993065862,1.43187699087},
    {1.56440264778,-3.07671953226,0.909407779551},
    {-2.02055817703,2.09043149138,0.909134115116},
    {0.897351747844,3.06996929226,0.93822169851},
    {4.44651678903,-3.77100617392,1.07067507629},
    {2.72584294202,3.64219413837,1.0571402801},
    {-1.20084762806,-1.26770091942,0.331709638634},
    {4.4539240771,1.8152130465,0.78650989763},
    {1.08900851337,-1.50046768365,0.76738881052},
    {-0.590899854433,2.99314968055,0.957265331945},
    {0.555152648594,-2.07292616135,1.17480092293},
    {-2.21516946098,-1.12518788548,0.783175178501},
    {0.43184221955,2.53361074021,0.766384983971},
    };
    

    Expected: equal to 8.26474 (+/- 1e-08)
    Actual: 8.70883.

    Have no clue what is wrong. Probably some magic related to doubles and precision, but I can't get where.

    https://gist.github.com/Lezh1k/0e4f948d5c7a99aef15a1973f715e837 - here is a not perfect visualization of path (not perfect because traversing through arcs look like lines, but they are not).

    Please give some hints :) Or maybe just show right path and I'll make changes accordingly.

  • Custom User Avatar
  • Custom User Avatar

    Finally solved with most stupid method I believe :)

  • Custom User Avatar

    ok, maybe I got it... will try later change the check, thank you

  • Custom User Avatar

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

  • Custom User Avatar
  • Custom User Avatar

    " ...---... -.-.-- - .... . --.- ..- .. -.-. -.- -... .-. --- .-- -. ..-. --- -..- .--- ..- -- .--. ... --- ...- . .-. - .... . .-.. .- --.. -.-- -.. --- --. .-.-.- "

    2 spaces should be at the beginning of result, right?
    So why the expected result is "SOS! THE" instead of " SOS! THE".

    If I ignore first spaces - another test fails. The one where expected result is " E E ".

    I'm using C.

  • Custom User Avatar

    Seems you are right. I will add the condition into my solution (in future, maybe :)
    Then C++ tests should be fixed.

  • Custom User Avatar

    Tried to use same solution in C++. Worked %)
    I believe that there is some issue with tests. Not enough precision of double type .

  • Custom User Avatar

    should be 7.75472560975609859, got 7.7547256097560977
    should be -0.185930520562766433, got -0.18593052056276646

    Attempted language is C.
    What can I do with this? Should I try long double instead of double? It works in local tests, but it does not here.

  • Custom User Avatar

    Could you explain this:
    parse_regexp('(abc)d') != parse_regexp('abcd')

    I have all tests passed except two of them. Both look like this simplified one:
    ((ab(cde))fg) = (ab(cde)fg) should be ((ab(cde))fg)

    At the same time ((abc)) => (abc) ?

  • Custom User Avatar

    I understand that this is not hardest issue ever. But my solution looks like totally wrong strategy. I'll take a look on that paper, thank you.

    btw I was thinking about SIFT or ORB, but they look too complex for me.
    Also I tried to find center of mass and get array of distances from each point to that center. After that I made FFT on array of distances and then tried to calculate correlation coefficient with template array. But it did not work. Or I made mistake somewhere. Anyway, thank you :) I'll read that paper first

  • Custom User Avatar

    Finally passed all tests :-D
    But I can not even understand other solutions %) Especially that one in kata description. @geoffp could you provide some info? Maybe link to paper or something like that?

  • Custom User Avatar

    Sorry, found error. At least found some strange thing in my code :)

  • Loading more items...