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 28, 2026 20:47Charles CabergsCharles CabergsScore: 93,645Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 28, 2026 20:4890,82054,816,24911,100,00025,228,0002,514,944
2Apr 28, 2026 20:4892,39757,605,23118,979,00017,980,0002,506,752
3Apr 28, 2026 20:4892,79255,559,55222,070,00015,047,0002,514,944
4Apr 28, 2026 20:4893,45756,584,28115,155,00022,228,0002,506,752
5Apr 28, 2026 20:4893,64557,177,54216,198,00021,260,0002,375,680
6Apr 28, 2026 20:4894,65555,387,47018,931,00018,931,0002,510,848
7Apr 28, 2026 20:4897,70262,160,61024,050,00015,031,0002,502,656
8Apr 28, 2026 20:4898,08057,438,25023,137,00016,095,0002,514,944
9Apr 28, 2026 20:4899,46757,913,47818,899,00020,888,0002,498,560