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 22, 2026 10:04M-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 22, 2026 10:06015,763,7153,490,0001,098,0002,121,728expected "57", got "50 "
2May 22, 2026 10:0611,38015,689,6403,464,0001,088,0002,121,728
3May 22, 2026 10:0611,53515,873,8983,566,0001,048,0002,121,728
4May 22, 2026 10:0611,60716,316,8343,467,0001,176,0002,121,728
5May 22, 2026 10:0611,63215,949,0103,593,0001,060,0002,121,728
6May 22, 2026 10:0611,65514,529,6643,607,0001,055,0002,121,728
7May 22, 2026 10:0611,76216,673,0793,619,0001,086,0002,121,728
8May 22, 2026 10:0611,85015,529,9003,676,0001,064,0002,121,728
9May 22, 2026 10:0612,12715,847,4243,560,0001,291,0002,121,728