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 11:02Dominique GarmierDominique GarmierScore: 28,252Success
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:0326,85525,847,1839,668,0001,074,0002,514,944
2Apr 23, 2026 11:0327,89732,872,7859,130,0002,029,0002,514,944
3Apr 23, 2026 11:0327,91228,784,8259,135,0002,030,0002,514,944
4Apr 23, 2026 11:0328,16528,567,8269,218,0002,048,0002,510,848
5Apr 23, 2026 11:0328,25226,559,3079,247,0002,054,0002,342,912
6Apr 23, 2026 11:0328,25728,899,92110,276,0001,027,0002,498,560
7Apr 23, 2026 11:0328,69533,457,26910,435,0001,043,0002,510,848
8Apr 23, 2026 11:0328,86734,665,72311,547,00002,514,944
9Apr 23, 2026 11:0329,67730,430,8739,893,0001,978,0002,510,848