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 listMay 11, 2026 12:57Victor 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
1May 11, 2026 12:5909,136,97402,106,0002,187,264expected "53", got "50 "
2May 11, 2026 12:593,8509,923,89801,540,0002,142,208
3May 11, 2026 12:594,86210,932,46701,945,0002,187,264
4May 11, 2026 12:594,93710,209,08401,975,0002,158,592
5May 11, 2026 12:595,25211,089,91002,101,0002,187,264
6May 11, 2026 12:595,27510,492,86402,110,0002,187,264
7May 11, 2026 12:595,34011,412,56202,136,0002,187,264
8May 11, 2026 12:595,50012,336,45302,200,0002,187,264
9May 11, 2026 12:595,77710,344,74302,311,0002,158,592