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 listApr 23, 2026 10:39Dominique GarmierDominique GarmierScore: 378,360Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 23, 2026 10:40377,505165,307,666150,002,0001,000,0002,314,240
2Apr 23, 2026 10:40377,702166,113,977149,080,0002,001,0002,514,944
3Apr 23, 2026 10:40377,950170,199,459149,178,0002,002,0002,506,752
4Apr 23, 2026 10:40378,195173,049,154150,277,0001,001,0002,342,912
5Apr 23, 2026 10:40378,360171,153,720150,342,0001,002,0002,342,912
6Apr 23, 2026 10:40378,490171,583,719150,394,0001,002,0002,510,848
7Apr 23, 2026 10:40378,602167,486,173150,439,0001,002,0002,506,752
8Apr 23, 2026 10:40378,605172,725,451150,440,0001,002,0002,514,944
9Apr 23, 2026 10:40378,852168,495,023150,538,0001,003,0002,506,752