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:02Dominique GarmierDominique GarmierScore: 47,895Success
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:0334,27229,468,72912,655,0001,054,0002,494,464
2Apr 21, 2026 10:0344,68745,568,38015,889,0001,986,0002,285,568
3Apr 21, 2026 10:0346,01545,585,25717,384,0001,022,0002,490,368
4Apr 21, 2026 10:0347,32543,503,79516,938,0001,992,0002,494,464
5Apr 21, 2026 10:0347,89544,404,13817,142,0002,016,0002,490,368
6Apr 21, 2026 10:0348,57742,168,44718,409,0001,022,0002,502,656
7Apr 21, 2026 10:0348,98251,513,15918,562,0001,031,0002,490,368
8Apr 21, 2026 10:0349,63249,379,10618,861,000992,0002,494,464
9Apr 21, 2026 10:0349,70750,446,19317,895,0001,988,0002,490,368