Largest Square Submatrix of all 1's NoSIMD_C#

Find the largest square submatrix consisting entirely of 1s as fast as possible.

Input

A 10,000 x 10,000 matrix of uint8 values (0 or 1) on STDIN.

0, 1, 0, 1, 1
0, 1, 1, 1, 1
0, 0, 1, 0, 0
1, 0, 1, 1, 0

Output

Print the side length of the largest all-ones square submatrix to STDOUT. The answer is guaranteed to be greater than 1.

For the example above, the output is:

2
Back to listJun 11, 2026 07:24Victor MerckléVictor MerckléScore: 28,282Success
Source Code

Source code access is restricted. Log in to request access.

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 11, 2026 07:314,86210,632,40301,945,0002,179,072
2Jun 11, 2026 07:317,55211,670,0961,359,0001,662,0002,179,072
3Jun 11, 2026 07:3128,22520,075,82910,141,0001,149,0002,134,016
4Jun 11, 2026 07:3128,25719,991,50510,151,0001,152,0002,138,112
5Jun 11, 2026 07:3128,28220,072,0149,891,0001,422,0002,174,976
6Jun 11, 2026 07:3128,29020,135,8569,888,0001,428,0002,174,976
7Jun 11, 2026 07:3128,31520,157,95210,261,0001,065,0002,129,920
8Jun 11, 2026 07:3128,32720,189,33010,022,0001,309,0002,174,976
9Jun 11, 2026 07:3128,51520,184,43810,255,0001,151,0002,129,920