Largest Square Submatrix of all 1's C#_user

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 listAug 23, 2026 16:27Andrew EpsteinAndrew EpsteinScore: 32,635Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Aug 23, 2026 16:2832,49722,840,70611,803,0001,196,0002,117,632
2Aug 23, 2026 16:2832,52222,804,26111,886,0001,123,0002,113,536
3Aug 23, 2026 16:2832,53222,842,84711,810,0001,203,0002,113,536
4Aug 23, 2026 16:2832,61223,947,84511,907,0001,138,0002,113,536
5Aug 23, 2026 16:2832,63522,926,54911,915,0001,139,0002,113,536
6Aug 23, 2026 16:2832,66022,979,57011,852,0001,212,0002,113,536
7Aug 23, 2026 16:2832,70723,563,08911,983,0001,100,0002,113,536
8Aug 23, 2026 16:2832,81222,973,86712,052,0001,073,0002,113,536
9Aug 23, 2026 16:2832,83522,838,86212,120,0001,014,0002,113,536