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 21:18olliecrowolliecrowScore: 352,668Success
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 21:18351,798164,317,800132,735,0007,984,0002,379,776
2Mar 5, 2026 21:18352,158165,745,624133,870,0006,993,0002,383,872
3Mar 5, 2026 21:18352,170173,896,100136,872,0003,996,0002,383,872
4Mar 5, 2026 21:18352,173166,071,852135,874,0004,995,0002,387,968
5Mar 5, 2026 21:18352,668165,436,452137,066,0004,001,0002,387,968
6Mar 5, 2026 21:18353,498171,228,928136,421,0004,978,0002,314,240
7Mar 5, 2026 21:18466,523212,186,296181,620,0004,989,0002,383,872
8Mar 5, 2026 21:18497,823225,242,725191,124,0008,005,0002,400,256
9Mar 5, 2026 21:18510,898230,920,097200,352,0004,007,0002,383,872