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 listMay 5, 2026 15:00Victor MerckléVictor MerckléScore: 8,030Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 5, 2026 15:015,26221,039,78502,105,0002,375,680
2May 5, 2026 15:015,67516,032,94902,270,0002,371,584
3May 5, 2026 15:017,34519,737,3071,345,0001,593,0002,371,584
4May 5, 2026 15:017,93219,688,0821,464,0001,709,0002,371,584
5May 5, 2026 15:018,03023,182,1241,528,0001,684,0002,367,488
6May 5, 2026 15:018,08519,139,3001,461,0001,773,0002,367,488
7May 5, 2026 15:018,09219,924,5971,472,0001,765,0002,375,680
8May 5, 2026 15:018,20019,216,3931,506,0001,774,0002,379,776
9May 5, 2026 15:018,31021,266,1211,517,0001,807,0002,367,488