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:12Dominique GarmierDominique GarmierScore: 101,140Success
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:0599,14371,902,36928,472,00011,185,0002,498,560
2Mar 15, 2026 10:0599,65069,081,62128,899,00010,961,0002,486,272
3Mar 15, 2026 10:0599,98365,082,46025,996,00013,997,0002,502,656
4Mar 15, 2026 10:1299,99367,531,77127,998,00011,999,0002,506,752
5Mar 15, 2026 10:05100,81561,620,84628,228,00012,098,0002,371,584
6Mar 15, 2026 10:05101,00366,966,76727,271,00013,130,0002,338,816
7Mar 15, 2026 10:12101,14065,809,85725,285,00015,171,0002,502,656
8Mar 15, 2026 10:05101,21364,536,21228,340,00012,145,0002,412,544
9Mar 15, 2026 10:05101,59572,619,30327,431,00013,207,0002,494,464
10Mar 15, 2026 10:05102,15068,390,96328,901,00011,959,0002,498,560
11Mar 15, 2026 10:05102,15370,243,76827,905,00012,956,0002,347,008
12Mar 15, 2026 10:12103,32871,136,17227,218,00014,113,0002,338,816