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 26, 2026 10:53Charles CabergsCharles CabergsScore: 107,547Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 26, 2026 10:55105,14759,399,35126,037,00016,022,0002,519,040stderr
2Apr 26, 2026 10:55106,36560,399,53820,260,00022,286,0002,314,240stderr
3Apr 26, 2026 10:55106,51060,033,35925,360,00017,244,0002,490,368stderr
4Apr 26, 2026 10:55107,43765,151,21318,989,00023,986,0002,498,560stderr
5Apr 26, 2026 10:55107,54764,103,10421,009,00022,010,0002,387,968stderr
6Apr 26, 2026 10:55107,74257,599,96220,045,00023,052,0002,498,560stderr
7Apr 26, 2026 10:55109,48763,830,76725,879,00017,916,0002,502,656stderr
8Apr 26, 2026 10:55110,85064,825,80422,170,00022,170,0002,412,544stderr
9Apr 26, 2026 10:55117,26064,096,77426,945,00019,959,0002,551,808stderr