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 26, 2026 21:20TudyMTudyMScore: 161,330Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 26, 2026 21:21152,81781,048,28157,119,0004,008,0002,514,944
2Apr 26, 2026 21:21155,28079,944,62358,105,0004,007,0002,502,656
3Apr 26, 2026 21:21160,73081,681,54756,256,0008,036,0002,506,752
4Apr 26, 2026 21:21160,89579,523,08258,325,0006,033,0002,523,136
5Apr 26, 2026 21:21161,33084,798,75459,491,0005,041,0002,514,944
6Apr 26, 2026 21:21161,41578,424,45362,549,0002,017,0002,510,848
7Apr 26, 2026 21:21161,83784,909,95761,701,0003,034,0002,519,040
8Apr 26, 2026 21:21162,34781,738,95961,942,0002,997,0002,510,848
9Apr 26, 2026 21:21163,97083,784,14860,543,0005,045,0002,514,944