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 14, 2026 11:44Dominique GarmierDominique GarmierScore: 515,340Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Mar 14, 2026 15:57514,725229,706,874203,892,0001,998,0002,506,752
2Mar 14, 2026 15:57515,130237,123,644205,052,0001,000,0002,506,752
3Mar 14, 2026 11:44515,158233,801,008205,063,0001,000,0002,494,464
4Mar 14, 2026 11:44515,178229,830,273204,071,0002,000,0002,289,664
5Mar 14, 2026 11:44515,210234,193,372204,084,0002,000,0002,289,664
6Mar 14, 2026 15:57515,213231,003,207204,085,0002,000,0002,289,664
7Mar 14, 2026 15:57515,248232,092,951204,099,0002,000,0002,494,464
8Mar 14, 2026 15:57515,285230,747,509204,113,0002,001,0002,338,816
9Mar 14, 2026 11:44515,333236,656,544204,132,0002,001,0002,494,464
10Mar 14, 2026 15:57515,340233,378,352204,135,0002,001,0002,502,656
11Mar 14, 2026 15:57515,375234,814,984204,149,0002,001,0002,289,664
12Mar 14, 2026 11:44515,378236,079,898204,150,0002,001,0002,289,664
13Mar 14, 2026 11:44515,428232,415,070204,170,0002,001,0002,289,664
14Mar 14, 2026 15:57515,480233,930,171204,191,0002,001,0002,289,664
15Mar 14, 2026 15:57515,503232,271,689205,201,0001,000,0002,494,464
16Mar 14, 2026 11:44515,930235,145,554205,371,0001,001,0002,502,656
17Mar 14, 2026 11:44515,950227,079,890205,379,0001,001,0002,494,464
18Mar 14, 2026 11:44516,288233,047,850205,513,0001,002,0002,502,656