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 listJun 11, 2026 08:43Victor MerckléVictor MerckléScore: 7,422Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 11, 2026 08:454,12012,275,80901,648,0002,142,208
2Jun 11, 2026 08:454,76211,071,95201,905,0002,166,784
3Jun 11, 2026 08:454,7679,320,93001,907,0002,195,456
4Jun 11, 2026 08:457,35512,064,2771,559,0001,383,0002,166,784
5Jun 11, 2026 08:457,42212,400,1821,666,0001,303,0002,195,456
6Jun 11, 2026 08:457,69012,772,5971,592,0001,484,0002,166,784
7Jun 11, 2026 08:457,84712,516,5271,667,0001,472,0002,158,592
8Jun 11, 2026 08:457,93012,792,3791,523,0001,649,0002,158,592
9Jun 11, 2026 08:457,93712,438,8941,613,0001,562,0002,158,592