Largest Square Submatrix of all 1's Haha Expert

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 listNov 30, 2026 23:18Dominique GarmierDominique GarmierScore: 5,135Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 30, 2026 23:214,74711,337,33501,899,0002,166,784
2Nov 30, 2026 23:214,81511,309,39501,926,0002,166,784
3Nov 30, 2026 23:215,02211,503,17802,009,0002,166,784
4Nov 30, 2026 23:215,09511,322,12702,038,0002,166,784
5Nov 30, 2026 23:215,13511,443,50202,054,0002,166,784
6Nov 30, 2026 23:215,20511,417,61702,082,0002,166,784
7Nov 30, 2026 23:215,27711,373,28802,111,0002,166,784
8Nov 30, 2026 23:215,52011,629,8421,078,0001,130,0002,166,784
9Nov 30, 2026 23:215,73711,578,8811,065,0001,230,0002,166,784