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 listMar 3, 2026 10:02MukundanMukundanScore: 59,743Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Mar 3, 2026 10:0259,31853,025,52522,696,0001,031,0002,277,376
2Mar 3, 2026 10:0259,70849,499,73822,888,000995,0002,469,888
3Mar 3, 2026 10:0259,72354,466,79123,889,00002,277,376
4Mar 3, 2026 10:0259,73548,090,00122,899,000995,0002,351,104
5Mar 3, 2026 10:0259,74352,461,31621,906,0001,991,0002,347,008
6Mar 3, 2026 10:0259,74547,397,42022,903,000995,0002,347,008
7Mar 3, 2026 10:0259,77849,362,02522,915,000996,0002,277,376
8Mar 3, 2026 10:0259,82845,062,68521,937,0001,994,0002,277,376
9Mar 3, 2026 10:0259,88052,117,94022,954,000998,0002,277,376