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 listMar 3, 2026 10:32MukundanMukundanScore: 54,158Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Mar 3, 2026 10:3253,98845,516,92721,595,00002,277,376
2Mar 3, 2026 10:3254,05545,184,22520,593,0001,029,0002,342,912
3Mar 3, 2026 10:3254,08848,044,61721,635,00002,334,720
4Mar 3, 2026 10:3254,09048,742,98720,606,0001,030,0002,277,376
5Mar 3, 2026 10:3254,15849,117,20120,632,0001,031,0002,347,008
6Mar 3, 2026 10:3254,17353,072,86921,669,00002,277,376
7Mar 3, 2026 10:3254,18347,110,19821,673,00002,351,104
8Mar 3, 2026 10:3254,26556,137,21821,706,00002,277,376
9Mar 3, 2026 10:3254,36053,507,69321,744,00002,347,008