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 listJan 2, 2026 15:29RoshanRoshanScore: 1,313,400Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jan 2, 2026 15:291,309,673549,951,947477,881,00045,988,0002,486,272
2Jan 2, 2026 15:291,310,805558,945,591478,294,00046,028,0002,355,200
3Jan 2, 2026 15:291,311,650550,173,920477,691,00046,969,0002,281,472
4Jan 2, 2026 15:291,311,973554,650,290478,808,00045,981,0002,510,848
5Jan 2, 2026 15:291,313,400557,258,828479,329,00046,031,0002,424,832
6Jan 2, 2026 15:291,313,570556,758,693480,392,00045,036,0002,482,176
7Jan 2, 2026 15:291,314,115550,198,781478,678,00046,968,0002,498,560
8Jan 2, 2026 15:291,314,618546,020,414479,861,00045,986,0002,285,568
9Jan 2, 2026 15:291,319,285553,042,271480,740,00046,974,0002,494,464