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 09:56MukundanMukundanScore: 59,735Success
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 09:5659,40058,194,24422,727,0001,033,0002,330,624
2Mar 3, 2026 09:5659,70548,512,12322,887,000995,0002,277,376
3Mar 3, 2026 09:5659,73048,134,42021,901,0001,991,0002,277,376
4Mar 3, 2026 09:5659,73554,353,60622,899,000995,0002,330,624
5Mar 3, 2026 09:5659,73553,262,34422,899,000995,0002,338,816
6Mar 3, 2026 09:5659,74353,034,35921,906,0001,991,0002,277,376
7Mar 3, 2026 09:5659,76048,259,21422,908,000996,0002,277,376
8Mar 3, 2026 09:5659,76347,158,62622,909,000996,0002,342,912
9Mar 3, 2026 09:5660,00546,912,03123,002,0001,000,0002,334,720