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 02:23Yuriy LyfenkoYuriy LyfenkoScore: 23,305Success
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Oct 5, 2026 20:38Andrew Epstein40.68CustomSolution Held
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Aug 18, 2025 02:5321,31328,384,6218,525,00002,281,472
2Aug 18, 2025 02:2321,44825,585,9897,507,0001,072,0002,281,472
3Aug 18, 2025 02:5321,56825,808,9177,549,0001,078,0002,281,472
4Aug 18, 2025 02:5321,69029,499,4347,592,0001,084,0002,510,848
5Aug 18, 2025 02:2321,70824,256,7127,598,0001,085,0002,510,848
6Aug 18, 2025 02:5321,80024,179,2797,630,0001,090,0002,277,376
7Aug 18, 2025 02:5322,48328,566,9156,995,0001,998,0002,273,280
8Aug 18, 2025 02:2323,21034,654,6347,221,0002,063,0002,277,376
9Aug 18, 2025 02:2323,28326,623,4827,244,0002,069,0002,281,472
10Aug 18, 2025 02:2323,30527,164,8077,251,0002,071,0002,277,376
11Aug 18, 2025 02:2323,43831,290,2668,334,0001,041,0002,277,376
12Aug 18, 2025 02:5323,53024,103,9518,367,0001,045,0002,523,136
13Aug 18, 2025 02:2323,55027,499,6059,420,00002,514,944
14Aug 18, 2025 02:5323,57528,870,4027,335,0002,095,0002,510,848
15Aug 18, 2025 02:5323,70023,624,6177,374,0002,106,0002,523,136
16Aug 18, 2025 02:2323,92329,223,0228,506,0001,063,0002,277,376
17Aug 18, 2025 02:5324,14327,957,5018,584,0001,073,0002,519,040
18Aug 18, 2025 02:2324,40825,536,0027,811,0001,952,0002,281,472