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 29, 2026 09:35Charles CabergsCharles CabergsScore: 95,540Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 29, 2026 09:3992,12056,104,26617,926,00018,922,0002,514,944stderr
2Apr 29, 2026 09:3992,82751,912,71617,060,00020,071,0002,519,040stderr
3Apr 29, 2026 09:3994,18751,417,71517,310,00020,365,0002,506,752stderr
4Apr 29, 2026 09:3994,76057,920,63316,957,00020,947,0002,523,136stderr
5Apr 29, 2026 09:3995,54053,840,29718,102,00020,114,0002,514,944stderr
6Apr 29, 2026 09:39100,45053,799,33320,090,00020,090,0002,338,816stderr
7Apr 29, 2026 09:39101,22262,671,63026,318,00014,171,0002,502,656stderr
8Apr 29, 2026 09:39101,65754,224,91421,348,00019,315,0002,514,944stderr
9Apr 29, 2026 09:39102,50063,257,20423,000,00018,000,0002,514,944stderr