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 23, 2025 14:02Sergey StreminSergey StreminScore: 553,025Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 23, 2025 14:02551,440251,642,858219,574,0001,002,0002,289,664
2May 23, 2025 14:02552,013252,443,704218,807,0001,998,0002,269,184
3May 23, 2025 14:02552,158243,668,988218,865,0001,998,0002,285,568
4May 23, 2025 14:02552,273249,845,188219,910,000999,0002,285,568
5May 23, 2025 14:02553,025244,253,047220,210,0001,000,0002,285,568
6May 23, 2025 14:02553,088247,738,519221,235,00002,269,184
7May 23, 2025 14:02555,210242,468,754220,084,0002,000,0002,285,568
8May 23, 2025 14:02555,850244,477,048221,339,0001,001,0002,285,568
9May 23, 2025 14:02556,350248,233,172221,538,0001,002,0002,277,376