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 4, 2026 11:44MukundanMukundanScore: 33,143Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Mar 4, 2026 11:4423,72329,361,0868,435,0001,054,0002,375,680
2Mar 4, 2026 11:4426,09528,898,81010,438,00002,277,376
3Mar 4, 2026 11:4426,53532,898,99110,614,00002,383,872
4Mar 4, 2026 11:4432,75333,329,65512,094,0001,007,0002,277,376
5Mar 4, 2026 11:4433,14342,282,84812,238,0001,019,0002,387,968
6Mar 4, 2026 11:4433,81334,501,56012,485,0001,040,0002,277,376
7Mar 4, 2026 11:4433,95832,246,03413,583,00002,383,872
8Mar 4, 2026 11:4434,38034,452,07513,752,00002,375,680
9Mar 4, 2026 11:4435,23833,023,45113,089,0001,006,0002,277,376