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 listAug 3, 2026 12:58Victor MerckléVictor MerckléScore: 4,410Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Aug 3, 2026 12:592,3658,815,733946,00002,117,632stderr
2Aug 3, 2026 12:593,38210,008,5081,353,00002,117,632stderr
3Aug 3, 2026 12:593,4229,375,0581,369,00002,117,632stderr
4Aug 3, 2026 12:593,46010,149,7401,384,00002,117,632stderr
5Aug 3, 2026 12:594,4109,658,6431,764,00002,117,632stderr
6Aug 3, 2026 12:594,47711,180,4241,791,00002,117,632stderr
7Aug 3, 2026 12:594,59210,601,6331,837,00002,117,632stderr
8Aug 3, 2026 12:594,7409,771,1971,896,00002,117,632stderr
9Aug 3, 2026 12:594,7559,850,4331,902,00002,117,632stderr