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 27, 2026 16:14Victor MerckléVictor MerckléScore: 6,647Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 27, 2026 16:156,29021,040,7591,258,0001,258,0002,523,136
2Apr 27, 2026 16:156,35021,341,7471,270,0001,270,0002,514,944
3Apr 27, 2026 16:156,39521,587,6211,279,0001,279,0002,519,040
4Apr 27, 2026 16:156,57517,826,4931,315,0001,315,0002,510,848
5Apr 27, 2026 16:156,64721,305,94302,659,0002,514,944
6Apr 27, 2026 16:156,76515,709,8101,353,0001,353,0002,519,040
7Apr 27, 2026 16:156,92519,719,4901,385,0001,385,0002,519,040
8Apr 27, 2026 16:157,00719,604,80602,803,0002,506,752
9Apr 27, 2026 16:157,06020,818,33502,824,0002,514,944