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 listSep 18, 2025 17:06AhamedAhamedScore: 938,103Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 18, 2025 17:06937,785402,794,218373,114,0002,000,0002,285,568
2Sep 18, 2025 17:06937,848406,766,906374,139,0001,000,0002,277,376
3Sep 18, 2025 17:06937,865399,664,130374,146,0001,000,0002,342,912
4Sep 18, 2025 17:06937,995398,259,311375,198,00002,285,568
5Sep 18, 2025 17:06938,103398,387,070375,241,00002,277,376
6Sep 18, 2025 17:06938,115402,131,251374,246,0001,000,0002,285,568
7Sep 18, 2025 17:06938,213402,216,326372,283,0003,002,0002,506,752
8Sep 18, 2025 17:06938,278396,349,750374,311,0001,000,0002,277,376
9Sep 18, 2025 17:06938,795400,005,256374,520,000998,0002,502,656