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 30, 2026 11:57Charles CabergsCharles CabergsScore: 58,007Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 30, 2026 12:0157,47240,442,03012,994,0009,995,0002,306,048
2Apr 30, 2026 12:0157,65242,619,45114,037,0009,024,0002,297,856
3Apr 30, 2026 12:0157,74538,386,91914,060,0009,038,0002,297,856
4Apr 30, 2026 12:0157,77245,438,29615,071,0008,038,0002,560,000
5Apr 30, 2026 12:0158,00738,262,54013,115,00010,088,0002,306,048
6Apr 30, 2026 12:0158,05245,020,80415,144,0008,077,0002,306,048
7Apr 30, 2026 12:0164,73542,791,36417,927,0007,967,0002,375,680
8Apr 30, 2026 12:0166,07241,800,11418,297,0008,132,0002,297,856
9Apr 30, 2026 12:0170,17247,267,93819,047,0009,022,0002,310,144