first of all , sorry for my bad English . im tring to sovle this problem http://codeforces.com/problemset/problem/225/C here is the idea i
ve : 1- get some of '#'s in each col 2- make 1D sum array of them (to be able to get number of #
s in a given range) 3- then for for each consecutive range of cols with width >=x && <=y make them all of one type (#s or .
s) and call the function with alternate type . here is my submission : http://codeforces.com/contest/225/submission/11485488 why getting time limit ? thanks in advance :)
you are not using the state array to store your answers :3 Modified code
^_^ :D , thanks ^_^ :D