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:18E SequeiraE SequeiraScore: 1,315,777Success
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:191,312,627559,310,396397,934,000127,117,000438,272
2May 9, 2026 19:191,314,005567,779,982397,715,000127,887,000430,080
3May 9, 2026 19:191,314,162560,612,101398,379,000127,286,000430,080
4May 9, 2026 19:191,315,145568,995,101397,974,000128,084,000479,232
5May 9, 2026 19:191,315,777562,374,542398,041,000128,270,000487,424
6May 9, 2026 19:191,316,770583,559,108398,775,000127,933,000430,080
7May 9, 2026 19:191,316,882568,301,463398,075,000128,678,000462,848
8May 9, 2026 19:191,317,675568,309,930398,133,000128,937,000430,080
9May 9, 2026 19:191,319,675564,588,294400,278,000127,592,000475,136