← All problemsSign in

Percolation in a cube

There is a 3D $N$x$N$X$N$ cube, initially all the $N^3$ sites in the cube are closed, there are $m$ steps which follow, in each step one site $(i,j,k)$ is chosen and it is opened if the site is closed. Two sites $(i_1,j_1,k_1)$ and $(i_2,j_2,k_2)$ are said to be adjacent if $|i_1-i_2| + |j_1-j_2| + |k_1-k_2|=1$ and both of these two sites are open. Two sites $s_1$ and $s_n$ are called conn

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start