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 21, 2026 17:29Charles CabergsCharles CabergsScore: 194,557Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 21, 2026 17:30190,36594,699,74434,065,00042,081,0002,539,520
2Apr 21, 2026 17:30192,22296,759,44530,955,00045,934,0002,531,328
3Apr 21, 2026 17:30193,01293,150,01633,523,00043,682,0002,539,520
4Apr 21, 2026 17:30193,99791,079,63532,249,00045,350,0002,531,328
5Apr 21, 2026 17:30194,55796,152,32136,916,00040,907,0002,527,232
6Apr 21, 2026 17:30195,71597,236,95836,132,00042,154,0002,502,656
7Apr 21, 2026 17:30209,790102,426,06738,961,00044,955,0002,306,048
8Apr 21, 2026 17:30210,080105,673,89140,015,00044,017,0002,408,448
9Apr 21, 2026 17:30215,665102,440,00639,121,00047,145,0002,359,296