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 listApr 27, 2026 19:37Victor MerckléVictor MerckléScore: 859,152Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 27, 2026 19:39854,187357,034,000323,693,00017,982,0002,338,816
2Apr 27, 2026 19:39855,527359,240,558326,202,00016,009,0002,342,912
3Apr 27, 2026 19:39857,652365,354,583331,059,00012,002,0002,338,816
4Apr 27, 2026 19:39858,692357,418,776327,455,00016,022,0002,347,008
5Apr 27, 2026 19:39859,152363,546,261325,627,00018,034,0002,342,912
6Apr 27, 2026 19:39859,605359,775,323330,848,00012,994,0002,326,528
7Apr 27, 2026 19:39860,180364,092,667329,069,00015,003,0002,338,816
8Apr 27, 2026 19:39860,377364,765,847329,145,00015,006,0002,342,912
9Apr 27, 2026 19:39860,465367,736,001329,178,00015,008,0002,342,912