Ad
  • Custom User Avatar
  • Default User Avatar

    You are taking a suboptimal path around the circle with centre at (2.83323324984,-1.17841666332). The path above and to the right of this circle is shorter.

  • 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
  • Default User Avatar

    The Wikipedia article on OCR-A is fairly detailed. If you want the TrueType font file, it can be downloaded for free from fontzone.com.

  • Custom User Avatar

    Still, I couldn't find a specification of this font online, so it was trial and error on my side to find specific patterns for digits.

  • 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

    Hi,

    It is meaningful because it's the "upper left corner of the ending of the spiral (when you're in the x area. I'm afaraid I cannot do better as an explanation, sorry...)

       |x
    +--+x 
    |xxxx
    |xxxx
    +---...
    
  • Custom User Avatar

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

  • Custom User Avatar
  • Default User Avatar

    NOTE: Extra spaces before or after the code have no meaning and should be ignored.

  • 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

    C++ tests are not correct. Your solution does not follow the problem specification: All operations with the same precedence should be evaluated from left to right. Here is a simple example: 74 * 71 / 33. This expression must be computed as (74 * 71) / 33. The expected result is 159.21212121212122. But your solution returns 159.2121212121212.

  • Loading more items...