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 29, 2026 12:05Charles CabergsCharles CabergsScore: 89,950Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 29, 2026 12:0688,53049,396,79616,188,00019,224,0002,342,912
2Apr 29, 2026 12:0688,80254,924,57120,298,00015,223,0002,478,080
3Apr 29, 2026 12:0688,84050,601,22914,214,00021,322,0002,531,328
4Apr 29, 2026 12:0689,50551,139,99815,912,00019,890,0002,510,848
5Apr 29, 2026 12:0689,95052,277,35313,992,00021,988,0002,510,848
6Apr 29, 2026 12:0691,01556,680,32218,203,00018,203,0002,514,944
7Apr 29, 2026 12:0692,11754,274,45714,938,00021,909,0002,514,944
8Apr 29, 2026 12:0695,35057,078,82912,044,00026,096,0002,510,848
9Apr 29, 2026 12:0699,95755,723,78825,989,00013,994,0002,342,912