I used gets in my program and it failed on 8 tests ( from 10). when I changed it to scanf it worked. Is it system's bug? Or we shuldn't use gets in programs?
z-factorial
I see , that aropan also used gets and got 20 points.
gets doesn't truncate the input (if there is a space after the last character)
or a newline character...
i guess i should fix the test cases and re-grade
i guess i should fix the test cases and re-grade
i have gets in z-knight and in z-sudoku, can that be problem ??
Yes , I understood. I wasn't reading only '!' characters.
Thanks.
Thanks.
that isn't very nice
i understand that examples aren't made bu you, but they sould be as it says in the task
i understand that examples aren't made bu you, but they sould be as it says in the task
@boris4
In z-knight you had to read till the end of input and gets does it.
In z-knight you had to read till the end of input and gets does it.
@boris:
your z-knight is not correct, it doesn't sort the output corretly
also you should never use gets (look at the compiler output)
ss.cc:(.text+0x412): warning: the `gets' function is dangerous and should not be used.
your z-knight is not correct, it doesn't sort the output corretly
also you should never use gets (look at the compiler output)
ss.cc:(.text+0x412): warning: the `gets' function is dangerous and should not be used.
i don't have that compiler output..
I have solved some problems using gets
What sort ?
int const dx[] = { -2, -1, 1, 2, 2, 1, -1, -2 };
int const dy[] = { 1, 2, 2, 1, -1, -2, -2, -1 };
I should just output in clockwise, and I am doing that.
I have solved some problems using gets
What sort ?
int const dx[] = { -2, -1, 1, 2, 2, 1, -1, -2 };
int const dy[] = { 1, 2, 2, 1, -1, -2, -2, -1 };
I should just output in clockwise, and I am doing that.
Is it hard problem to count number of consecutive '!'s on input line?
I don't think so!
Ok, i agree to admin to revalidate, with new checker, but as competitors You must handle various formats on input and output.
Think about this situation, in Your next competition.
for this test case
a8 f3
you output:
d4 e5 g5 h4 h2 g1 e1 d2
and it should be:
g5 h4 h2 g1 e1 d2 d4 e5
a8 f3
you output:
d4 e5 g5 h4 h2 g1 e1 d2
and it should be:
g5 h4 h2 g1 e1 d2 d4 e5
@boris4:
I used arrays :
const int ia[8]={1,2,2,1,-1,-2,-2,-1};
const int ja[8]={2,1,-1,-2,-2,-1,1,2};
I used arrays :
const int ia[8]={1,2,2,1,-1,-2,-2,-1};
const int ja[8]={2,1,-1,-2,-2,-1,1,2};
@boris: you switched rows and columns i guess
yes i switched row and column and dx[] isn't correct because first he needs to go up... so
int const dx[] = { 1, 2, 2, 1, -1, -2, -2, -1 };
int const dy[] = { 2, 1, -1, -2, -2, -1, 1, 2 };
is correct
stupid mistake...
thx all.
int const dx[] = { 1, 2, 2, 1, -1, -2, -2, -1 };
int const dy[] = { 2, 1, -1, -2, -2, -1, 1, 2 };
is correct
stupid mistake...
thx all.