Page 2 of 2

Posted: Fri Jul 25, 2008 11:33 pm
by m!nus
what's the point of quoting that?...

mod challenges have become too easy wwith the division fix

btw: my php HVM works fine and has quite a few command line options

Mod/Fast Mod

Posted: Wed Mar 21, 2012 2:03 pm
by General_Payne
Well, after struggling with Mod and the 10000 cycle limit i then realized the obvious easy solution.

Kind of made Fast Mod a case of copy paste.

Posted: Tue Jul 23, 2013 7:05 pm
by Isaev
Expected: '1', got: '' for input '13,3'
Expected: '4', got: '' for input '34,6'
Expected: '96', got: '' for input '1566,294'
Expected: '9', got: '' for input '1799139,10'
2 test(s) passed
.... is incorrect.

How two?

Code: Select all

#include <stdio.h>
#include <string.h>

main()
{
    printf("n=%d\n", 13 % 3);
    printf("n=%d\n", 34 % 6);
    printf("n=%d\n", 1566 % 294);
    printf("n=%d\n", 1799139 % 10);  
}
n=1
n=4
n=96
n=9

Posted: Tue Jul 23, 2013 11:49 pm
by CodeX
Assuming that was with code that prints nothing out: it's because an empty string is assumed to be 0 by PHP's casting so happens to be interpreted as correct by the test script. As far as I recall all the VM test scripts don't print out the input/output for any tests passed and even some 'secret' tests failed so 6 tests have been done but you only see 4.

Posted: Wed Jul 24, 2013 6:27 am
by Isaev
Ah... passed is incorrect? also two of six is incorrect? then everything clearly. I thought it's differently.