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 28, 2026 23:19Charles CabergsCharles CabergsScore: 94,317Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 28, 2026 23:2088,44551,924,45823,249,00012,129,0002,404,352
2Apr 28, 2026 23:2092,93255,929,11819,089,00018,084,0002,506,752
3Apr 28, 2026 23:2093,35555,815,52618,166,00019,176,0002,514,944
4Apr 28, 2026 23:2094,17556,224,22718,326,00019,344,0002,506,752
5Apr 28, 2026 23:2094,31755,159,14115,295,00022,432,0002,514,944
6Apr 28, 2026 23:2094,43754,066,35318,377,00019,398,0002,514,944
7Apr 28, 2026 23:2094,80554,290,24024,949,00012,973,0002,514,944
8Apr 28, 2026 23:2097,24553,855,75518,425,00020,473,0002,519,040
9Apr 28, 2026 23:2097,41055,106,14114,986,00023,978,0002,506,752