Page 1 of 1

11231 - Black and white painting

Posted: Sat Jul 07, 2007 4:43 pm
by hamedv
what's wrong with my code???

Code: Select all

GOT AC

Posted: Sat Jul 07, 2007 4:48 pm
by Adrian Kuegel
It is too complicated :wink:
I suggest you think again, or try small cases with a brute force program and compare the values.

Posted: Sat Jul 07, 2007 4:49 pm
by mf
Here's some random input:

Code: Select all

15 9 0
9 9 0
89 35 0
11 16 1
16 14 0
10 17 0
11 17 1
12 11 0
17 13 1
16 10 1
12 10 1
15 9 1
17 8 1
0 0 0
Output:

Code: Select all

8
2
1148
18
31
15
20
10
30
14
8
8
5

Posted: Sat Jul 07, 2007 5:03 pm
by hamedv
thanx for your fast reply
GOT AC