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:21Dominique GarmierDominique GarmierScore: 7,362Success
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:246,94012,221,3771,389,0001,387,0002,187,264
2Nov 30, 2026 23:247,12712,434,3531,428,0001,423,0002,187,264
3Nov 30, 2026 23:247,35512,863,6091,472,0001,470,0002,187,264
4Nov 30, 2026 23:247,35713,027,9921,472,0001,471,0002,187,264
5Nov 30, 2026 23:247,36215,918,4211,463,0001,482,0002,187,264
6Nov 30, 2026 23:247,40013,058,3161,465,0001,495,0002,187,264
7Nov 30, 2026 23:248,01513,830,7851,580,0001,626,0002,187,264
8Nov 30, 2026 23:2431,63722,870,00111,535,0001,120,0002,162,688
9Nov 30, 2026 23:2431,73025,568,02311,570,0001,122,0002,162,688