July 17, 2017
On Monday, 17 July 2017 at 07:14:26 UTC, Andrea Fontana wrote:

> Probably using ndslice library could help you!

Unfortunately, that's not possible on most online contest platforms like Codeforces.  For each programming language and compiler available, only the most basic package is usually installed on the server.  There is a mix of reasons involved (historical, maintenance, choice of libraries, more equality for different languages, etc.).  That means, e.g., no numpy for Python, no Boost for C++, and no third-party libraries for D.

Ivan Kazmenko.

July 17, 2017
> As for the problem itself, it can be solved without finding connected components.  I won't post the solution right away because it is potentially a spoiler.  See http://codeforces.com/blog/entry/53268 for problem analysis (828B) and http://codeforces.com/contest/828/submission/28637184 for an example implementation in D.
>
> Ivan Kazmenko.

Wow I understand the question wrongly than,

WWWWB
WWWWW
WWWBB
WWBWW

I excepted there should be two B squares here.

One 3*3 and another 1*1.
And my answer would be 6 instead 12 here.

Yes if there can be only one black square than my solution would be much more simple.

One good thing about D community is when I ask a question here you guys are really nice that I get inspired.

Thanks Ivan


1 2
Next ›   Last »