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 listAug 18, 2025 03:47Yuriy LyfenkoYuriy LyfenkoError
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Oct 5, 2026 20:38Andrew Epstein32.07CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 5, 2026 20:42016,929,134,92316,907,675,0009,190,0002,117,632expected "17", got "50 "
2Aug 18, 2025 03:4712,78022,139,0704,090,0001,022,0002,273,280
3Aug 18, 2025 03:4712,85021,603,5933,084,0002,056,0002,281,472
4Aug 18, 2025 03:4712,90525,501,4244,130,0001,032,0002,273,280
5Aug 18, 2025 03:4712,92521,732,4303,102,0002,068,0002,514,944
6Aug 18, 2025 03:4713,15322,426,1473,157,0002,104,0002,281,472
7Aug 18, 2025 03:4713,27822,228,4653,187,0002,124,0002,269,184
8Aug 18, 2025 03:4713,36523,168,5414,277,0001,069,0002,273,280
9Aug 18, 2025 03:4713,39021,988,2984,285,0001,071,0002,375,680
10Aug 18, 2025 03:4713,78822,379,9494,412,0001,103,0002,281,472
11Oct 5, 2026 20:4232,658,79713,074,929,13213,056,396,0007,123,0002,117,632
12Oct 5, 2026 20:4234,751,63513,912,111,01213,893,591,0007,063,0002,117,632