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 28, 2026 07:56Victor MerckléVictor MerckléError
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 28, 2026 07:57021,450,04801,899,0002,359,296expected "55", got "50 "
2Apr 28, 2026 07:574,13722,491,52501,655,0002,355,200
3Apr 28, 2026 07:574,23518,575,21901,694,0002,359,296
4Apr 28, 2026 07:574,81015,215,55301,924,0002,359,296
5Apr 28, 2026 07:574,84725,694,36701,939,0002,363,392
6Apr 28, 2026 07:574,88719,540,03801,955,0002,355,200
7Apr 28, 2026 07:575,01020,583,61102,004,0002,359,296
8Apr 28, 2026 07:575,05517,458,67802,022,0002,342,912
9Apr 28, 2026 07:575,09225,603,71602,037,0002,355,200