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 5, 2026 22:44Sergey SerebryakovSergey SerebryakovScore: 21,588Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Mar 5, 2026 22:4420,82526,730,2556,248,0002,082,0002,277,376
2Mar 5, 2026 22:4421,04830,874,8548,419,00002,277,376
3Mar 5, 2026 22:4421,14828,963,5048,459,00002,347,008
4Mar 5, 2026 22:4421,39031,836,1218,556,00002,277,376
5Mar 5, 2026 22:4421,58829,011,8317,556,0001,079,0002,277,376
6Mar 5, 2026 22:4421,59524,425,5528,638,00002,342,912
7Mar 5, 2026 22:4421,67523,545,4717,587,0001,083,0002,351,104
8Mar 5, 2026 22:4421,78024,575,1087,623,0001,089,0002,277,376
9Mar 5, 2026 22:4422,23026,320,8248,892,00002,277,376