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:46Victor MerckléVictor MerckléScore: 857,942Success
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:48857,557359,012,940341,023,0002,000,0002,498,560
2Apr 28, 2026 07:48857,712367,500,870341,085,0002,000,0002,494,464
3Apr 28, 2026 07:48857,847369,298,130340,138,0003,001,0002,494,464
4Apr 28, 2026 07:48857,912360,578,052342,165,0001,000,0002,502,656
5Apr 28, 2026 07:48857,942367,698,045342,177,0001,000,0002,494,464
6Apr 28, 2026 07:48858,037357,465,815342,215,0001,000,0002,322,432
7Apr 28, 2026 07:48858,092362,811,806342,237,0001,000,0002,498,560
8Apr 28, 2026 07:48858,392363,701,954342,356,0001,001,0002,498,560
9Apr 28, 2026 07:48858,440359,825,366342,375,0001,001,0002,297,856