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
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
On Sunday, 16 July 2017 at 21:50:19 UTC, kerdemdemir wrote:
Process(row-1,column-1, maxrow, maxcolumn);
Process(row,column-1, maxrow, maxcolumn);
Process(row+1,column-1, maxrow, maxcolumn);
On Sunday, 16 July 2017 at 10:37:39 UTC, kerdemdemir wrote:
My goal is to find connected components in a 2D array for
example finding connected '*'
chars below.
You can also use a queue to avoid recursion that should improve
performances and readibility.
Probably using ndslice library
Of course now I will try to have it work first. Than replace for
loops with Cartesian product calls. Than I will make 2D array
template and even maybe with random access range. And finally for
being able to use this class later in the some other coding
challenge I will make Searching( == 'W'
Hi Guys,
@Nicholas , thanks a lot for cool solution but actually I weren't
working on image processing. I was trying to solve
"http://codeforces.com/contest/828/problem/B;. I really needed
finding connected components this time.
@Ivan, your solution is much more elegant than what I did. But
On 16.07.2017 19:10, Timon Gehr wrote:
...
(This works even if there are * at the border.)
Well, not really. :)
Version that actually works if there are * at the border:
import std.stdio, std.range, std.algorithm, std.array;
char[][] arr;
int componentSize(int row,int col){
On 16.07.2017 18:55, Timon Gehr wrote:
On 16.07.2017 12:37, kerdemdemir wrote:
My goal is to find connected components in a 2D array for example
finding connected '*'
chars below.
x x x x x x
x x x x x x
x x * * x x
x x * * x x
x x x * * x
* x x x x x
On 16.07.2017 12:37, kerdemdemir wrote:
My goal is to find connected components in a 2D array for example
finding connected '*'
chars below.
x x x x x x
x x x x x x
x x * * x x
x x * * x x
x x x * * x
* x x x x x
There are two connected '*' group in
On Sunday, 16 July 2017 at 10:37:39 UTC, kerdemdemir wrote:
My goal is to find connected components in a 2D array for
example finding connected '*'
chars below.
x x x x x x
x x x x x x
x x * * x x
x x * * x x
x x x * * x
* x x x x x
...
Is there any
On Sunday, 16 July 2017 at 10:37:39 UTC, kerdemdemir wrote:
My goal is to find connected components in a 2D array for
example finding connected '*'
chars below.
x x x x x x
x x x x x x
x x * * x x
x x * * x x
x x x * * x
* x x x x x
There are two connected
My goal is to find connected components in a 2D array for example
finding connected '*'
chars below.
x x x x x x
x x x x x x
x x * * x x
x x * * x x
x x x * * x
* x x x x x
There are two connected '*' group in this example. First group is
composes of six
12 matches
Mail list logo