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 listAug 8, 2026 16:37mgildermgilderScore: 1,278,927Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Aug 8, 2026 16:381,267,110542,330,931385,814,000121,030,0002,146,304
2Aug 8, 2026 16:381,269,430534,928,093386,008,000121,764,0002,158,592
3Aug 8, 2026 16:381,277,070540,480,462385,599,000125,229,0002,191,360
4Aug 8, 2026 16:381,278,112537,487,040387,551,000123,694,0002,134,016
5Aug 8, 2026 16:381,278,927539,412,839389,825,000121,746,0002,134,016
6Aug 8, 2026 16:381,278,977536,894,199385,859,000125,732,0002,134,016
7Aug 8, 2026 16:381,279,935555,298,038388,948,000123,026,0002,117,632
8Aug 8, 2026 16:381,280,427537,814,385389,899,000122,272,0002,170,880
9Aug 8, 2026 16:381,283,762540,793,461387,783,000125,722,0002,146,304