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:59Victor MerckléVictor MerckléScore: 3,656,830Success
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 14:023,654,8471,479,693,3871,460,940,000999,0002,392,064stderr
2Apr 27, 2026 14:023,654,9271,481,450,7061,460,972,000999,0002,371,584stderr
3Apr 27, 2026 14:023,655,7571,478,613,1051,460,304,0001,999,0002,461,696stderr
4Apr 27, 2026 14:023,656,6671,483,068,9691,459,670,0002,997,0002,326,528stderr
5Apr 27, 2026 14:023,656,8301,482,292,8741,461,733,000999,0002,392,064stderr
6Apr 27, 2026 14:023,657,2221,483,984,7481,460,891,0001,998,0002,387,968stderr
7Apr 27, 2026 14:023,657,6871,480,657,2001,461,077,0001,998,0002,392,064stderr
8Apr 27, 2026 14:023,658,7851,481,449,0951,461,515,0001,999,0002,392,064stderr
9Apr 27, 2026 14:023,659,1471,481,659,9841,460,660,0002,999,0002,379,776stderr