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 15:34Victor MerckléVictor MerckléScore: 8,595Success
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 15:356,25020,322,4111,250,0001,250,0002,510,848
2Apr 27, 2026 15:356,28516,937,82102,514,0002,514,944
3Apr 27, 2026 15:356,41519,405,8741,283,0001,283,0002,519,040
4Apr 27, 2026 15:356,42519,918,2241,285,0001,285,0002,514,944
5Apr 27, 2026 15:358,59522,495,0242,292,0001,146,0002,514,944
6Apr 27, 2026 15:358,73018,769,1322,328,0001,164,0002,527,232
7Apr 27, 2026 15:358,87217,515,9032,366,0001,183,0002,338,816
8Apr 27, 2026 15:358,89720,698,9162,373,0001,186,0002,514,944
9Apr 27, 2026 15:358,94724,622,9062,386,0001,193,0002,523,136