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 23, 2026 10:59Dominique GarmierDominique GarmierScore: 28,772Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 23, 2026 11:0026,46027,024,7179,526,0001,058,0002,351,104
2Apr 23, 2026 11:0027,23029,226,2778,912,0001,980,0002,355,200
3Apr 23, 2026 11:0028,13733,631,76910,232,0001,023,0002,359,296
4Apr 23, 2026 11:0028,71225,910,44310,441,0001,044,0002,334,720
5Apr 23, 2026 11:0028,77227,009,39710,463,0001,046,0002,363,392
6Apr 23, 2026 11:0028,78527,511,88410,468,0001,046,0002,355,200
7Apr 23, 2026 11:0029,05533,807,23910,566,0001,056,0002,355,200
8Apr 23, 2026 11:0029,27029,841,30810,644,0001,064,0002,355,200
9Apr 23, 2026 11:0029,31528,480,51310,660,0001,066,0002,355,200