Largest Square Submatrix of all 1's C#_user

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 15, 2026 23:34Victor MerckléVictor MerckléScore: 14,982Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Aug 15, 2026 23:463,88029,561,35101,552,0002,134,016stderr
2Aug 15, 2026 23:464,17230,485,23001,669,0002,134,016stderr
3Aug 15, 2026 23:467,06233,046,1941,413,0001,412,0002,134,016stderr
4Aug 15, 2026 23:468,79731,530,8121,166,0002,353,0002,134,016stderr
5Aug 15, 2026 23:4614,98234,960,0322,381,0003,612,0002,134,016stderr
6Aug 15, 2026 23:4617,75235,967,9463,550,0003,551,0002,134,016stderr
7Aug 15, 2026 23:4617,86736,095,5183,574,0003,573,0002,134,016stderr
8Aug 15, 2026 23:4618,86536,362,8773,773,0003,773,0002,134,016stderr
9Aug 15, 2026 23:4620,32036,973,9004,064,0004,064,0002,134,016stderr