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 19, 2026 18:45izotoffizotoffScore: 1,623,305Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 19, 2026 18:481,622,552675,333,940531,092,000117,929,00094,208
2Nov 19, 2026 18:481,622,637672,602,746529,944,000119,111,00061,440
3Nov 19, 2026 18:481,622,775677,332,306531,026,000118,084,00069,632
4Nov 19, 2026 18:481,623,205665,960,093531,545,000117,737,000147,456
5Nov 19, 2026 18:481,623,305673,512,574532,448,000116,874,00094,208
6Nov 19, 2026 18:481,626,422683,229,502531,772,000118,797,00053,248
7Nov 19, 2026 18:481,633,780675,944,275530,992,000122,520,00049,152
8Nov 19, 2026 18:481,635,205697,198,937531,236,000122,846,00049,152
9Nov 19, 2026 18:481,641,230684,594,058531,551,000124,941,00045,056