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 24, 2026 22:32e1011e1011Score: 1,341,977Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 24, 2026 22:331,335,855564,616,071411,421,000122,921,00077,824
2Nov 24, 2026 22:331,336,060563,808,820411,785,000122,639,00073,728
3Nov 24, 2026 22:331,338,005562,715,909412,430,000122,772,00057,344
4Nov 24, 2026 22:331,341,550578,687,546413,431,000123,189,00061,440
5Nov 24, 2026 22:331,341,977569,970,274411,831,000124,960,00020,480
6Nov 24, 2026 22:331,343,500567,805,125414,530,000122,870,00077,824
7Nov 24, 2026 22:331,344,797573,269,367412,540,000125,379,00020,480
8Nov 24, 2026 22:331,347,067575,850,678414,430,000124,397,00049,152
9Nov 24, 2026 22:331,349,917564,139,770412,710,000127,257,00020,480