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 16:09Victor MerckléVictor MerckléScore: 26,140Success
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 16:106,30220,254,75502,521,0002,506,752
2Apr 27, 2026 16:1010,91223,168,6463,274,0001,091,0002,514,944
3Apr 27, 2026 16:1011,72519,916,0932,345,0002,345,0002,506,752
4Apr 27, 2026 16:1018,28225,163,6256,269,0001,044,0002,510,848
5Apr 27, 2026 16:1026,14029,911,5979,411,0001,045,0002,506,752
6Apr 27, 2026 16:1026,66228,591,3159,599,0001,066,0002,519,040
7Apr 27, 2026 16:1027,46229,915,3779,987,000998,0002,342,912
8Apr 27, 2026 16:1027,57528,821,3028,022,0003,008,0002,506,752
9Apr 27, 2026 16:1028,03726,956,2969,176,0002,039,0002,523,136