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:40Victor MerckléVictor MerckléScore: 3,640,127Success
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:413,631,5151,470,712,3761,450,607,0001,999,0002,326,528stderr
2Apr 27, 2026 13:413,637,8251,474,044,4561,455,130,00002,387,968stderr
3Apr 27, 2026 13:413,638,0871,473,045,4791,453,237,0001,998,0002,326,528stderr
4Apr 27, 2026 13:413,638,5701,471,335,3181,453,429,0001,999,0002,330,624stderr
5Apr 27, 2026 13:413,640,1271,473,891,3431,453,053,0002,998,0002,326,528stderr
6Apr 27, 2026 13:413,640,3351,471,266,6771,454,136,0001,998,0002,379,776stderr
7Apr 27, 2026 13:413,640,5051,476,162,9951,454,204,0001,998,0002,392,064stderr
8Apr 27, 2026 13:413,641,2601,472,477,6191,454,505,0001,999,0002,383,872stderr
9Apr 27, 2026 13:413,641,6871,472,139,9591,454,676,0001,999,0002,379,776stderr