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 13:34Victor MerckléVictor MerckléScore: 3,380,087Success
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 13:363,376,9751,369,084,1721,349,791,000999,0002,379,776stderr
2Apr 27, 2026 13:363,378,5351,371,739,0351,350,415,000999,0002,379,776stderr
3Apr 27, 2026 13:363,379,3601,368,978,4301,349,746,0001,998,0002,387,968stderr
4Apr 27, 2026 13:363,379,9921,369,403,6761,350,998,000999,0002,465,792stderr
5Apr 27, 2026 13:363,380,0871,368,889,5531,351,035,0001,000,0002,383,872stderr
6Apr 27, 2026 13:363,380,3001,375,031,7621,350,122,0001,998,0002,383,872stderr
7Apr 27, 2026 13:363,380,4201,367,860,6181,350,170,0001,998,0002,326,528stderr
8Apr 27, 2026 13:363,381,1601,371,628,6991,351,465,000999,0002,330,624stderr
9Apr 27, 2026 13:363,383,4171,375,909,9391,351,368,0001,999,0002,383,872stderr