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 11, 2026 13:21Victor MerckléVictor MerckléScore: 6,462Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 11, 2026 13:255,74511,690,54702,298,0002,174,976
2May 11, 2026 13:256,28210,947,58102,513,0002,174,976
3May 11, 2026 13:256,44210,930,12402,577,0002,174,976
4May 11, 2026 13:256,44511,132,72502,578,0002,174,976
5May 11, 2026 13:256,46211,104,60102,585,0002,174,976
6May 11, 2026 13:256,52511,113,26302,610,0002,174,976
7May 11, 2026 13:256,52511,007,0421,305,0001,305,0002,174,976
8May 11, 2026 13:256,60212,707,0241,321,0001,320,0002,174,976
9May 11, 2026 13:256,60512,257,3051,322,0001,320,0002,138,112