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 28, 2026 11:07Victor MerckléVictor MerckléScore: 5,837Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 28, 2026 11:083,94016,044,18201,576,0002,359,296
2Apr 28, 2026 11:084,19223,282,3001,677,00002,363,392
3Apr 28, 2026 11:085,63721,464,53902,255,0002,363,392
4Apr 28, 2026 11:085,65521,918,5491,131,0001,131,0002,363,392
5Apr 28, 2026 11:085,83719,410,24102,335,0002,363,392
6Apr 28, 2026 11:086,00021,004,01202,400,0002,355,200
7Apr 28, 2026 11:086,03220,564,27102,413,0002,347,008
8Apr 28, 2026 11:086,03520,230,47502,414,0002,371,584
9Apr 28, 2026 11:086,04521,666,7471,209,0001,209,0002,347,008