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:26Dominique GarmierDominique GarmierScore: 7,852Success
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:317,53213,547,1471,509,0001,504,0002,179,072
2Nov 30, 2026 23:317,60512,178,6631,533,0001,509,0002,179,072
3Nov 30, 2026 23:317,61512,106,5061,525,0001,521,0002,179,072
4Nov 30, 2026 23:317,68012,128,3071,531,0001,541,0002,179,072
5Nov 30, 2026 23:317,85212,309,7501,579,0001,562,0002,179,072
6Nov 30, 2026 23:318,44212,451,2461,699,0001,678,0002,179,072
7Nov 30, 2026 23:3131,39521,892,49411,444,0001,114,0002,162,688
8Nov 30, 2026 23:3131,75522,006,21511,588,0001,114,0002,162,688
9Nov 30, 2026 23:3132,03222,070,38011,711,0001,102,0002,162,688