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 26, 2026 16:40LeighAtkinsLeighAtkinsScore: 106,807Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 26, 2026 16:566,43511,787,2851,333,0001,241,0002,121,728
2Nov 26, 2026 16:566,71211,921,4581,351,0001,334,0002,121,728
3Nov 26, 2026 16:566,89012,310,4291,405,0001,351,0002,121,728
4Nov 26, 2026 16:56106,39551,811,18835,932,0006,626,0002,117,632
5Nov 26, 2026 16:56106,80751,955,98236,089,0006,634,0002,117,632
6Nov 26, 2026 16:56107,53252,287,18936,273,0006,740,0002,117,632
7Nov 26, 2026 16:56107,99052,908,03536,085,0007,111,0002,117,632
8Nov 26, 2026 16:56108,52053,066,97736,263,0007,145,0002,117,632
9Nov 26, 2026 16:56127,67060,296,05544,328,0006,740,0002,117,632