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 30, 2026 06:47Charles CabergsCharles CabergsScore: 58,282Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 30, 2026 06:4857,14737,829,25214,908,0007,951,0002,363,392
2Apr 30, 2026 06:4857,51046,499,65913,002,00010,002,0002,297,856
3Apr 30, 2026 06:4857,54740,603,19411,009,00012,010,0002,383,872
4Apr 30, 2026 06:4857,80239,475,75613,068,00010,053,0002,301,952
5Apr 30, 2026 06:4858,28245,379,68812,163,00011,150,0002,310,144
6Apr 30, 2026 06:4861,65242,291,55015,413,0009,248,0002,560,000
7Apr 30, 2026 06:4863,80042,518,07715,312,00010,208,0002,297,856
8Apr 30, 2026 06:4864,41043,009,99417,837,0007,927,0002,297,856
9Apr 30, 2026 06:4864,89242,811,90718,969,0006,988,0002,560,000