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 25, 2026 21:02Charles CabergsCharles CabergsScore: 151,550Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 25, 2026 21:03148,25775,698,27729,149,00030,154,0002,506,752stderr
2Apr 25, 2026 21:03149,82779,693,45327,968,00031,963,0002,334,720stderr
3Apr 25, 2026 21:03150,23076,711,66630,046,00030,046,0002,330,624stderr
4Apr 25, 2026 21:03151,23577,940,83230,247,00030,247,0002,498,560stderr
5Apr 25, 2026 21:03151,55079,523,92027,279,00033,341,0002,514,944stderr
6Apr 25, 2026 21:03152,31780,520,38430,963,00029,964,0002,502,656stderr
7Apr 25, 2026 21:03153,68275,236,81127,209,00034,264,0002,326,528stderr
8Apr 25, 2026 21:03156,53079,009,05532,316,00030,296,0002,502,656stderr
9Apr 25, 2026 21:03158,00582,602,84933,106,00030,096,0002,502,656stderr