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 listApr 21, 2026 10:11Dominique GarmierDominique GarmierScore: 46,315Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 21, 2026 10:1332,35531,696,29210,951,0001,991,0002,494,464
2Apr 21, 2026 10:1343,55742,703,45715,374,0002,049,0002,494,464
3Apr 21, 2026 10:1344,74744,568,63816,847,0001,052,0002,494,464
4Apr 21, 2026 10:1345,86744,654,36616,309,0002,038,0002,494,464
5Apr 21, 2026 10:1346,31542,259,30517,497,0001,029,0002,486,272
6Apr 21, 2026 10:1346,53043,538,50117,578,0001,034,0002,494,464
7Apr 21, 2026 10:1347,14242,765,04616,872,0001,985,0002,502,656
8Apr 21, 2026 10:1347,19538,243,77516,891,0001,987,0002,494,464
9Apr 21, 2026 10:1347,78549,042,58917,102,0002,012,0002,494,464