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 21:35TudyMTudyMScore: 115,592Success
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 21:36109,94261,262,07936,981,0006,996,0002,318,336
2Apr 26, 2026 21:36111,39267,122,76738,481,0006,076,0002,310,144
3Apr 26, 2026 21:36114,09566,717,67338,539,0007,099,0002,314,240
4Apr 26, 2026 21:36114,46263,294,78738,818,0006,967,0002,338,816
5Apr 26, 2026 21:36115,59265,873,53842,217,0004,020,0002,314,240
6Apr 26, 2026 21:36116,05765,853,74840,368,0006,055,0002,314,240
7Apr 26, 2026 21:36116,18067,680,37040,411,0006,061,0002,310,144
8Apr 26, 2026 21:36116,54263,050,34439,523,0007,094,0002,314,240
9Apr 26, 2026 21:36116,78062,435,41343,666,0003,046,0002,396,160