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 listMar 3, 2026 03:56MukundanMukundanScore: 9,199,755Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Mar 3, 2026 03:568,811,2833,552,323,6163,480,532,00043,981,0002,510,848
2Mar 3, 2026 03:568,930,2633,600,673,9253,530,128,00041,977,0002,281,472
3Mar 3, 2026 03:569,107,4603,675,481,5803,598,009,00044,975,0002,498,560
4Mar 3, 2026 03:569,114,3953,673,762,8453,596,789,00048,969,0002,355,200
5Mar 3, 2026 03:569,199,7553,708,332,7893,631,917,00047,985,0002,498,560
6Mar 3, 2026 03:569,293,0403,740,873,7483,674,237,00042,979,0002,494,464
7Mar 3, 2026 03:569,322,4033,755,244,4983,682,987,00045,974,0002,502,656
8Mar 3, 2026 03:569,404,8483,787,335,8713,718,963,00042,976,0002,306,048
9Mar 3, 2026 03:569,441,9903,803,597,4243,703,820,00072,976,0002,498,560