11957 - Checkers

All about problems in Volume 119. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
yatsen
Learning poster
Posts: 68
Joined: Fri Nov 23, 2001 2:00 am
Location: taiwan

11957 - Checkers

Post by yatsen »

I got WA for 11957. I use dp. Can anyone help?

Code: Select all

/* Q11957 - Checkers */
cut.... after AC
Last edited by yatsen on Thu Aug 02, 2012 9:35 pm, edited 1 time in total.

outsbook
New poster
Posts: 26
Joined: Fri Oct 28, 2011 2:42 am

Re: 11957 - Checkers

Post by outsbook »

Try the input

Input:

Code: Select all

3
10
..........
..........
..........
..........
..........
..........
..........
..........
..........
....W.....
20
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
.........W..........
30
..............................
..............................
...............B..............
......................B.......
...............B..............
......................B.......
...............B..............
......................B.......
...............B..............
...............B..............
......................B.......
..............................
...............B..............
......................B.......
...............B..............
......................B.......
...............B..............
B.....B...............B.......
..............................
..............................
..............................
B.....B...............B.......
...............B..............
......................B.......
...............B..............
......................B.......
...............B..............
B.....B...............B.......
...............B..............
...........W..................
Output:

Code: Select all

Case 1: 436
Case 2: 508020
Case 3: 523174
You can test your own input at http://www.outsbook.com/uva/?page=probl ... 9&id=11957
"Learning to love yourself is the greatest love of all" - Michael Masser and Linda Creed

yatsen
Learning poster
Posts: 68
Joined: Fri Nov 23, 2001 2:00 am
Location: taiwan

Re: 11957 - Checkers

Post by yatsen »

My output is the same as yours.
But WA. why? :(

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 11957 - Checkers

Post by brianfry713 »

Line 42 should be if(y-2>=0)
Check input and AC output for thousands of problems on uDebug!

yatsen
Learning poster
Posts: 68
Joined: Fri Nov 23, 2001 2:00 am
Location: taiwan

Re: 11957 - Checkers

Post by yatsen »

brianfry713 wrote:Line 42 should be if(y-2>=0)
Thank you soooooooo much!
What a stupid mistake I made!

Post Reply

Return to “Volume 119 (11900-11999)”