I keep getting a 'wrong answer' for my ACODE solution, but I can't find any problems with the ouput of my program. My program perfectly conforms to the example I/O, and all other input I've tried properly gives me the solutions I expected.
From the example:
$ cat input
25114
1111111111
3333333333
0
$ ./acode < input
6
89
1
Testing long input:
$ perl -le 'print (3x5000)."\n0"' | ./acode
1
I use printf("%lld\n") to output an integer of type 'long long', one possibility could be that the server doesn't use 64 bits for that, but I doubt the GCC 4.0.0-8 on the server would be that much different from the GCC 4.3.1 I use.
Could someone provide me with a bit more example I/O on which my program may fail, or any other suggestions?