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 4, 2026 22:07olliecrowolliecrowError
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 4, 2026 22:09016,503,5261,684,00002,461,696expected "70", got "50"
2May 4, 2026 22:094,50517,609,5821,802,00002,469,888
3May 4, 2026 22:094,56719,683,7801,827,00002,465,792
4May 4, 2026 22:094,57216,176,8311,829,00002,461,696
5May 4, 2026 22:094,66013,632,2301,864,00002,457,600
6May 4, 2026 22:094,67514,835,7411,870,00002,469,888
7May 4, 2026 22:095,04214,550,8392,017,00002,469,888
8May 4, 2026 22:095,23017,854,1862,092,00002,453,504
9May 4, 2026 22:095,48016,892,6202,192,00002,465,792