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 14:04Victor MerckléVictor MerckléScore: 3,802,377Success
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 14:063,799,7051,538,923,0081,518,883,000999,0002,453,504stderr
2Apr 27, 2026 14:063,801,0221,543,413,6281,517,411,0002,998,0002,326,528stderr
3Apr 27, 2026 14:063,801,3721,541,106,1781,518,550,0001,999,0002,379,776stderr
4Apr 27, 2026 14:063,802,2601,538,608,2711,517,907,0002,997,0002,371,584stderr
5Apr 27, 2026 14:063,802,3771,548,590,7391,518,953,0001,998,0002,326,528stderr
6Apr 27, 2026 14:063,802,6921,538,943,8321,519,079,0001,998,0002,387,968stderr
7Apr 27, 2026 14:063,803,4671,539,654,2011,519,388,0001,999,0002,379,776stderr
8Apr 27, 2026 14:063,803,5421,541,075,9281,518,419,0002,998,0002,387,968stderr
9Apr 27, 2026 14:063,805,5951,539,665,6011,520,239,0001,999,0002,383,872stderr