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 listSep 15, 2026 00:26Josu San MartinJosu San MartinScore: 253,240Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 15, 2026 00:28249,320108,391,77361,543,00038,185,0002,117,632
2Sep 15, 2026 00:28251,360109,286,67662,852,00037,692,0002,117,632
3Sep 15, 2026 00:28251,830109,440,08562,613,00038,119,0002,117,632
4Sep 15, 2026 00:28252,782109,810,36462,630,00038,483,0002,117,632
5Sep 15, 2026 00:28253,240109,869,56562,834,00038,462,0002,117,632
6Sep 15, 2026 00:28257,382111,750,63064,255,00038,698,0002,117,632
7Sep 15, 2026 00:28262,540113,704,53766,062,00038,954,0002,117,632
8Sep 15, 2026 00:28266,267115,186,29466,765,00039,742,0002,117,632
9Sep 15, 2026 00:28268,392116,907,94668,043,00039,314,0002,117,632