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 20, 2026 16:46BenBenScore: 755,120Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 20, 2026 16:49754,630327,699,358299,853,0001,999,0002,310,144
2Apr 20, 2026 16:49754,770324,741,936299,909,0001,999,0002,322,432
3Apr 20, 2026 16:49754,855332,496,905299,943,0001,999,0002,310,144
4Apr 20, 2026 16:49754,910330,289,330299,965,0001,999,0002,306,048
5Apr 20, 2026 16:49755,120330,637,557300,048,0002,000,0002,322,432
6Apr 20, 2026 16:49755,175328,474,611300,070,0002,000,0002,310,144
7Apr 20, 2026 16:49755,300327,279,199300,120,0002,000,0002,510,848
8Apr 20, 2026 16:49755,310330,604,950300,124,0002,000,0002,310,144
9Apr 20, 2026 16:49757,382318,744,285299,954,0002,999,0002,494,464