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 listJun 2, 2025 01:25Hayden DonnellyHayden DonnellyScore: 5,670,513Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 2, 2025 01:255,400,0602,187,393,6802,160,024,00002,269,184
2Jun 2, 2025 01:255,421,8702,191,269,4732,166,750,0001,998,0002,269,184
3Jun 2, 2025 01:255,502,0452,230,576,0952,198,820,0001,998,0002,531,328
4Jun 2, 2025 01:255,551,9832,246,121,5452,218,795,0001,998,0002,510,848
5Jun 2, 2025 01:255,670,5132,294,825,9382,268,205,00002,433,024
6Jun 2, 2025 01:255,789,7702,345,380,8292,315,908,00002,433,024
7Jun 2, 2025 01:255,931,3232,406,111,0832,370,531,0001,998,0002,531,328
8Jun 2, 2025 01:256,279,3932,533,524,7892,510,758,000999,0002,531,328
9Jun 2, 2025 01:256,835,0852,756,889,2152,733,035,000999,0002,531,328