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 16, 2026 16:11Victor MerckléVictor MerckléScore: 629,450Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Aug 16, 2026 16:16629,16731,672,511,576251,667,00002,121,728stderr
2Aug 16, 2026 16:16629,23016,290,787,285251,692,00002,121,728stderr
3Aug 16, 2026 16:16629,31014,020,045,857251,724,00002,121,728stderr
4Aug 16, 2026 16:16629,31728,639,927,064251,727,00002,121,728stderr
5Aug 16, 2026 16:16629,45011,461,001,178250,775,0001,005,0002,121,728stderr
6Aug 16, 2026 16:16629,73035,390,955,795250,855,0001,037,0002,121,728stderr
7Aug 16, 2026 16:16803,96737,330,697,100321,587,00002,121,728stderr
8Aug 16, 2026 16:16804,52729,650,924,531321,811,00002,121,728stderr
9Aug 16, 2026 16:161,255,65222,931,415,579502,261,00002,121,728stderr