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 24, 2026 07:53Dominique GarmierDominique GarmierScore: 305,450Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 24, 2026 07:54292,055133,139,610101,845,00014,977,0002,527,232
2Apr 24, 2026 07:54299,115141,571,238105,570,00014,076,0002,519,040
3Apr 24, 2026 07:54302,420137,472,933108,972,00011,996,0002,400,256
4Apr 24, 2026 07:54304,372142,631,484104,784,00016,965,0002,371,584
5Apr 24, 2026 07:54305,450141,669,463107,158,00015,022,0002,527,232
6Apr 24, 2026 07:54306,090146,255,698109,390,00013,046,0002,527,232
7Apr 24, 2026 07:54311,375143,898,769113,502,00011,048,0002,514,944
8Apr 24, 2026 07:54313,467147,875,144108,335,00017,052,0002,531,328
9Apr 24, 2026 07:54318,300143,784,632116,293,00011,027,0002,519,040