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 listMay 20, 2026 17:34M-RochatM-RochatScore: 222,777Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 20, 2026 17:35219,13098,408,63774,553,00013,099,0002,113,536
2May 20, 2026 17:35220,19298,678,93374,718,00013,359,0002,113,536
3May 20, 2026 17:35221,30598,397,16875,439,00013,083,0002,113,536
4May 20, 2026 17:35221,955102,443,37175,480,00013,302,0002,113,536
5May 20, 2026 17:35222,777100,278,97875,810,00013,301,0002,113,536
6May 20, 2026 17:35223,28099,041,74775,969,00013,343,0002,113,536
7May 20, 2026 17:35223,322101,189,42076,185,00013,144,0002,113,536
8May 20, 2026 17:35223,43099,314,01776,198,00013,174,0002,113,536
9May 20, 2026 17:35225,257101,464,38376,757,00013,346,0002,113,536