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 9, 2026 18:52Josu San MartinJosu San MartinError
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 9, 2026 18:5308,554,0042,137,00002,469,888expected "59", got "50 "
2May 9, 2026 18:535,0378,451,1862,015,00002,465,792
3May 9, 2026 18:535,4458,483,4062,178,00002,461,696
4May 9, 2026 18:535,4528,545,4262,181,00002,469,888
5May 9, 2026 18:535,5979,705,5932,239,00002,469,888
6May 9, 2026 18:535,9058,539,24502,362,0002,473,984
7May 9, 2026 18:536,2308,580,2362,492,00002,457,600
8May 9, 2026 18:536,5458,907,8702,618,00002,473,984
9May 9, 2026 18:536,8858,204,4022,754,00002,465,792