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 19:01M-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 19:02015,931,8244,193,0002,125,0002,121,728expected "57", got "50 "
2May 16, 2026 19:0215,51017,399,5214,966,0001,238,0002,121,728
3May 16, 2026 19:0215,52716,861,4294,971,0001,240,0002,121,728
4May 16, 2026 19:0215,61016,835,7024,997,0001,247,0002,121,728
5May 16, 2026 19:0215,80715,539,9015,060,0001,263,0002,121,728
6May 16, 2026 19:0215,84015,774,1105,070,0001,266,0002,121,728
7May 16, 2026 19:0216,00715,787,7084,245,0002,158,0002,121,728
8May 16, 2026 19:0216,28017,598,4184,315,0002,197,0002,121,728
9May 16, 2026 19:0216,54716,483,8634,393,0002,226,0002,121,728