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 10:41limanjun99limanjun99Score: 39,515Success
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 10:4439,28237,814,05514,666,0001,047,0002,510,848
2Apr 24, 2026 10:4439,34533,776,27814,689,0001,049,0002,519,040
3Apr 24, 2026 10:4439,40238,450,93514,711,0001,050,0002,535,424
4Apr 24, 2026 10:4439,47534,148,44413,817,0001,973,0002,531,328
5Apr 24, 2026 10:4439,51531,912,51513,831,0001,975,0002,519,040
6Apr 24, 2026 10:4439,55031,940,47113,843,0001,977,0002,531,328
7Apr 24, 2026 10:4439,55734,069,53814,769,0001,054,0002,519,040
8Apr 24, 2026 10:4439,59233,797,31013,858,0001,979,0002,338,816
9Apr 24, 2026 10:4439,61533,133,17415,846,00002,342,912