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 listMar 23, 2026 01:23olliecrowolliecrowScore: 5,060Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Mar 23, 2026 01:233,37013,741,0221,348,00002,494,464
2Mar 23, 2026 01:233,98822,265,4451,595,00002,490,368
3Mar 23, 2026 01:235,02019,492,2461,004,0001,004,0002,498,560
4Mar 23, 2026 01:235,03527,252,8101,007,0001,007,0002,498,560
5Mar 23, 2026 01:235,06017,511,7781,012,0001,012,0002,281,472
6Mar 23, 2026 01:235,24515,651,11102,098,0002,498,560
7Mar 23, 2026 01:235,28020,683,4561,056,0001,056,0002,494,464
8Mar 23, 2026 01:235,54019,695,4481,108,0001,108,0002,498,560
9Mar 23, 2026 01:235,62523,913,1691,125,0001,125,0002,281,472