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 22, 2026 21:45olliecrowolliecrowScore: 10,482Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 22, 2026 21:4610,22522,585,2482,045,0002,045,0002,543,616
2Apr 22, 2026 21:4610,26518,464,8102,053,0002,053,0002,551,808
3Apr 22, 2026 21:4610,27520,538,3402,055,0002,055,0002,555,904
4Apr 22, 2026 21:4610,32019,600,0192,064,0002,064,0002,555,904
5Apr 22, 2026 21:4610,48221,689,1191,048,0003,145,0002,560,000
6Apr 22, 2026 21:4610,51019,955,4943,153,0001,051,0002,551,808
7Apr 22, 2026 21:4610,54522,623,4813,164,0001,054,0002,543,616
8Apr 22, 2026 21:4610,59523,422,4423,179,0001,059,0002,555,904
9Apr 22, 2026 21:4610,75220,364,27104,301,0002,543,616