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 24, 2026 15:08olliecrowolliecrowScore: 10,590Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 24, 2026 15:1010,25022,770,2382,050,0002,050,0002,551,808
2Apr 24, 2026 15:1010,43524,672,0032,087,0002,087,0002,547,712
3Apr 24, 2026 15:1010,52519,934,3913,158,0001,052,0002,551,808
4Apr 24, 2026 15:1010,58517,267,9553,176,0001,058,0002,539,520
5Apr 24, 2026 15:1010,59020,035,9113,177,0001,059,0002,551,808
6Apr 24, 2026 15:1010,63519,952,3694,254,00002,547,712
7Apr 24, 2026 15:1010,72517,952,7403,218,0001,072,0002,547,712
8Apr 24, 2026 15:1010,75020,849,2892,150,0002,150,0002,547,712
9Apr 24, 2026 15:1010,76017,928,5563,228,0001,076,0002,555,904