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 listMar 15, 2026 10:15Dominique GarmierDominique GarmierScore: 80,335Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Mar 15, 2026 10:1531,01038,246,61511,371,0001,033,0002,375,680
2Mar 15, 2026 10:1534,74035,207,62512,904,000992,0002,375,680
3Mar 15, 2026 10:1738,35032,090,48513,295,0002,045,0002,281,472
4Mar 15, 2026 10:1746,78550,269,17518,714,00002,281,472
5Mar 15, 2026 10:1773,81058,150,92229,524,00002,281,472
6Mar 15, 2026 10:1774,65356,656,21927,871,0001,990,0002,281,472
7Mar 15, 2026 10:1576,68557,684,12129,652,0001,022,0002,359,296
8Mar 15, 2026 10:1577,23560,034,11428,901,0001,993,0002,367,488
9Mar 15, 2026 10:1778,65560,881,85831,462,00002,281,472
10Mar 15, 2026 10:1580,33554,403,33832,134,00002,371,584
11Mar 15, 2026 10:1581,53055,109,63532,612,00002,281,472
12Mar 15, 2026 10:1781,71860,188,25431,666,0001,021,0002,281,472
13Mar 15, 2026 10:1782,26556,279,05531,909,000997,0002,281,472
14Mar 15, 2026 10:1583,51554,600,56633,406,00002,281,472
15Mar 15, 2026 10:1784,09062,034,66932,617,0001,019,0002,281,472
16Mar 15, 2026 10:1784,26359,063,33033,705,00002,281,472
17Mar 15, 2026 10:1585,53062,991,67533,206,0001,006,0002,281,472
18Mar 15, 2026 10:1587,50361,747,69734,001,0001,000,0002,473,984