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 24, 2026 09:54limanjun99limanjun99Score: 112,107Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 24, 2026 09:56111,52059,168,63143,595,0001,013,0002,506,752
2Apr 24, 2026 09:56111,60563,435,04743,628,0001,014,0002,519,040
3Apr 24, 2026 09:56111,89762,142,66143,742,0001,017,0002,514,944
4Apr 24, 2026 09:56112,01258,650,74242,814,0001,991,0002,510,848
5Apr 24, 2026 09:56112,10761,181,04542,850,0001,993,0002,510,848
6Apr 24, 2026 09:56112,12758,636,80142,858,0001,993,0002,514,944
7Apr 24, 2026 09:56115,61265,664,03745,240,0001,005,0002,506,752
8Apr 24, 2026 09:56115,75569,241,20945,296,0001,006,0002,510,848
9Apr 24, 2026 09:56115,84061,865,83645,329,0001,007,0002,510,848