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 23:54olliecrowolliecrowError
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 23:55018,802,6271,328,00002,502,656expected "54", got "50"
2May 5, 2026 23:55018,499,4171,200,00002,490,368expected "55", got "50"
3May 5, 2026 23:552,95215,070,2321,181,00002,506,752
4May 5, 2026 23:552,96515,679,6591,186,00002,502,656
5May 5, 2026 23:553,24017,087,8451,296,00002,502,656
6May 5, 2026 23:553,24015,355,2091,296,00002,502,656
7May 5, 2026 23:553,25516,578,5311,302,00002,498,560
8May 5, 2026 23:553,25717,772,2991,303,00002,498,560
9May 5, 2026 23:553,28017,234,9611,312,00002,498,560