Largest Square Submatrix of all 1's NoSIMD_C#

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 listMay 9, 2026 17:54Aleksei ShahoikaAleksei ShahoikaError
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 9, 2026 17:55027,881,69210,138,0001,071,0002,351,104expected "50", got "88"
2May 9, 2026 17:5523,63726,309,9658,389,0001,066,0002,367,488
3May 9, 2026 17:5529,39028,694,41410,678,0001,078,0002,363,392
4May 9, 2026 17:5529,95727,510,99710,918,0001,065,0002,355,200
5May 9, 2026 17:5530,50727,215,35711,144,0001,059,0002,367,488
6May 9, 2026 17:5530,61730,561,73911,182,0001,065,0002,371,584
7May 9, 2026 17:5530,84728,421,64411,285,0001,054,0002,355,200
8May 9, 2026 17:5531,00227,862,62911,342,0001,059,0002,363,392
9May 9, 2026 17:5531,27731,030,11311,413,0001,098,0002,359,296