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 listMay 9, 2026 19:03E SequeiraE SequeiraScore: 153,132Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 9, 2026 19:04143,80273,200,72156,440,0001,081,0002,367,488
2May 9, 2026 19:04149,63278,299,62658,738,0001,115,0002,375,680
3May 9, 2026 19:04149,97776,434,67458,929,0001,062,0002,375,680
4May 9, 2026 19:04151,74775,236,35859,655,0001,044,0002,371,584
5May 9, 2026 19:04153,13279,449,34760,163,0001,090,0002,375,680
6May 9, 2026 19:04162,39281,958,00463,846,0001,111,0002,371,584
7May 9, 2026 19:04172,33787,119,65667,860,0001,075,0002,383,872
8May 9, 2026 19:04203,015100,550,26980,113,0001,093,0002,379,776
9May 9, 2026 19:04230,987109,465,86891,281,0001,114,0002,375,680