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 27, 2026 21:23Victor MerckléVictor MerckléScore: 5,305Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 27, 2026 21:244,22017,657,3131,688,00002,347,008
2Apr 27, 2026 21:244,47721,459,3011,791,00002,355,200
3Apr 27, 2026 21:244,71018,047,105942,000942,0002,347,008
4Apr 27, 2026 21:245,10517,960,79602,042,0002,347,008
5Apr 27, 2026 21:245,30520,621,8531,061,0001,061,0002,428,928
6Apr 27, 2026 21:245,63017,318,8411,126,0001,126,0002,433,024
7Apr 27, 2026 21:245,79022,106,4041,158,0001,158,0002,351,104
8Apr 27, 2026 21:245,84516,780,24202,338,0002,355,200
9Apr 27, 2026 21:246,01718,415,2842,407,00002,363,392