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:53TudyMTudyMScore: 100,260Success
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:5496,81055,576,48031,591,0007,133,0002,318,336
2Apr 26, 2026 21:5497,92561,102,60834,149,0005,021,0002,310,144
3Apr 26, 2026 21:5498,66261,968,27435,418,0004,047,0002,310,144
4Apr 26, 2026 21:5498,84559,930,70934,469,0005,069,0002,322,432
5Apr 26, 2026 21:54100,26059,887,49134,963,0005,141,0002,318,336
6Apr 26, 2026 21:54100,32059,069,54833,106,0007,022,0002,314,240
7Apr 26, 2026 21:54100,67557,081,74436,243,0004,027,0002,433,024
8Apr 26, 2026 21:54101,07558,149,42334,366,0006,064,0002,310,144
9Apr 26, 2026 21:54101,72759,969,41934,588,0006,103,0002,461,696