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 16, 2026 15:39M-RochatM-RochatError
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 16, 2026 15:41024,719,64012,709,0003,189,0002,113,536expected "73", got "49 "
2May 16, 2026 15:41026,072,18612,250,0003,088,0002,117,632expected "63", got "49 "
3May 16, 2026 15:41025,948,43112,735,0002,120,0002,113,536expected "83", got "50 "
4May 16, 2026 15:4134,91222,885,28811,818,0002,147,0002,117,632
5May 16, 2026 15:4137,44223,851,24311,747,0003,230,0002,113,536
6May 16, 2026 15:4137,56524,933,02411,776,0003,250,0002,113,536
7May 16, 2026 15:4138,09726,748,80612,164,0003,075,0002,113,536
8May 16, 2026 15:4139,56027,004,18512,643,0003,181,0002,113,536
9May 16, 2026 15:4140,14027,631,05412,835,0003,221,0002,113,536