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 23, 2026 13:50Charles CabergsCharles CabergsScore: 148,340Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 23, 2026 13:51145,80576,846,24029,161,00029,161,0002,510,848
2Apr 23, 2026 13:51147,16278,459,49530,929,00027,936,0002,514,944
3Apr 23, 2026 13:51148,12278,089,53019,080,00040,169,0002,506,752
4Apr 23, 2026 13:51148,28576,409,13832,170,00027,144,0002,519,040
5Apr 23, 2026 13:51148,34073,854,85627,154,00032,182,0002,510,848
6Apr 23, 2026 13:51150,81577,028,61630,163,00030,163,0002,519,040
7Apr 23, 2026 13:51151,39075,023,12438,352,00022,204,0002,510,848
8Apr 23, 2026 13:51151,71775,931,71936,810,00023,877,0002,318,336
9Apr 23, 2026 13:51154,08578,231,67130,312,00031,322,0002,514,944