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 16, 2026 08:48apuxbtapuxbtScore: 941,617Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 16, 2026 08:49939,757386,185,882332,430,00043,473,0002,113,536
2Sep 16, 2026 08:49940,017386,297,475332,303,00043,704,0002,113,536
3Sep 16, 2026 08:49940,732386,687,648332,390,00043,903,0002,113,536
4Sep 16, 2026 08:49940,977386,615,789332,505,00043,886,0002,113,536
5Sep 16, 2026 08:49941,617386,907,939332,485,00044,162,0002,113,536
6Sep 16, 2026 08:49941,670387,002,211332,359,00044,309,0002,113,536
7Sep 16, 2026 08:49941,677386,958,546332,343,00044,328,0002,113,536
8Sep 16, 2026 08:49941,830387,767,875332,309,00044,423,0002,113,536
9Sep 16, 2026 08:49941,872386,989,061332,616,00044,133,0002,113,536