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 14, 2026 16:50Josu San MartinJosu San MartinScore: 1,469,545Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 14, 2026 17:011,466,302595,177,585585,514,0001,007,0002,129,920
2May 14, 2026 17:011,467,827595,783,570585,880,0001,251,0002,129,920
3May 14, 2026 17:011,468,042597,419,575586,216,0001,001,0002,129,920
4May 14, 2026 17:011,468,170595,940,024586,021,0001,247,0002,129,920
5May 14, 2026 17:011,469,545596,481,744586,791,0001,027,0002,129,920
6May 14, 2026 17:011,470,412596,778,510586,892,0001,273,0002,129,920
7May 14, 2026 17:011,471,000597,063,461587,159,0001,241,0002,129,920
8May 14, 2026 17:011,473,435598,043,617588,128,0001,246,0002,129,920
9May 14, 2026 17:011,474,335599,301,420588,733,0001,001,0002,129,920