Page 2 of 3

Posted: Sat Feb 17, 2007 5:57 pm
by algoJo
it's strange...
is the i/o in problem description are right??
how came

INPUT

Code: Select all

1

1
8
7 2 1 4
OUTPUT

Code: Select all

2
can't figure out how...
and what are the output for
INPUT

Code: Select all

1

1
6
2 3 2 3

Posted: Sat Feb 17, 2007 8:32 pm
by mf
how came

INPUT

Code: Select all

1

1
8
7 2 1 4
OUTPUT

Code: Select all

2
Here's a picture of this sample case:

Code: Select all

  1 2 3 4 5 6 7 8
1 . . . c . . . .
2 . . . . \ . . .
3 . . . . . b . .
4 . . . . / . . .
5 . . . / . . . .
6 . . / . . . . .
7 . a . . . . . .
8 . . . . . . . .
Bishop can move from (7,2) to (3,6), and then to (1,4). That's 2 moves.

Posted: Tue Feb 20, 2007 10:41 am
by algoJo
Thanks for replying mf.. :D
Got accepted :)

Posted: Wed Nov 07, 2007 4:40 am
by mohsincsedu
I have a problem:

I can not find any output greater than 2.

my algo is:

1. x1,y1,x2,y2 <------- take input
2. if x1+y1 and x2+y2 both odd or even
a) if x1+y1 and x2+y2 are equal
number of move is 1
b) else
number of move is 2
3. else
no move



am i right..

Posted: Wed Nov 07, 2007 10:59 am
by helloneo
Well.. there is one more case.. think about it.. :-)

Re: 10849 -WA!!!

Posted: Fri Jul 04, 2008 4:21 pm
by Prianka
Hello everybody, I am getting WA with this code. What is the bug?
Please help me.

Code: Select all

cut
I also try long long int.
thanks..

Re: 10849 - Move the bishop

Posted: Fri Jul 04, 2008 5:34 pm
by maruf
check this input:
1 1 2 2
output of my acc code is:
1
hope it will help....there are more conditions than u have assumed....... :roll:

Re: 10849 - Move the bishop

Posted: Fri Jul 04, 2008 8:05 pm
by Prianka
Hi, Maruf,
I add this condition but still getting WA!!!!!!!!!!

Code: Select all

else if(x1==y1 && x2==y2)
				printf("1\n");
thanks.

Re: 10849 - Move the bishop

Posted: Fri Jul 04, 2008 8:26 pm
by maruf
what will happen if the bishop or the target is placed out of the board??
you should consider the black and white cells of the chess board accurately.......
the bishop can be white and black colours too..... :roll:

Re: 10849 - Move the bishop

Posted: Fri Jul 04, 2008 9:39 pm
by Prianka
give me some sample input output please........

Re: 10849 - Move the bishop

Posted: Sat Jul 05, 2008 3:36 pm
by maruf
check this input && output :roll:
1 //test case
16 // the number of tests for that case.
5 //chess board with NxN squares

1 1 1 1
0
1 1 2 1
no move
1 1 1 2
no move
1 1 2 2
1
1 1 6 1
no move
1 1 1 3
2
1 1 3 1
2
2 1 3 1
no move
2 1 3 2
1
2 1 2 3
2
1 1 5 5
1
1 2 5 4
2
1 1 1 5
2
1 2 1 5
no move
2 2 2 2
0
6 3 1 4
no move

Re: 10849 - Move the bishop

Posted: Sat Jul 05, 2008 6:45 pm
by Prianka
Hello maruf,
I check ur input.All is matched with me without the last one.
It shows 2.
But your output is'no move',
But why?
it should be 2, is not it?
Here is my code?
please help.I am fade up with is problem,
thanks for help.........

Code: Select all

acc

Re: 10849 - Move the bishop

Posted: Sat Jul 05, 2008 7:20 pm
by maruf
cut

Re: 10849 - Move the bishop

Posted: Sat Jul 05, 2008 7:50 pm
by Prianka
Still getting WA!!!!!!!!!!!!!
I change my code

Please help!!!!!!!r valo lage na.

Code: Select all

acc

Re: 10849 - Move the bishop

Posted: Sat Jul 05, 2008 9:37 pm
by maruf
cut