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 21, 2026 15:28Charles CabergsCharles CabergsScore: 194,695Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 21, 2026 15:29193,01297,058,32433,088,00044,117,0002,535,424
2Apr 21, 2026 15:29193,19790,956,98234,123,00043,156,0002,535,424
3Apr 21, 2026 15:29194,05596,711,54238,307,00039,315,0002,539,520
4Apr 21, 2026 15:29194,07093,960,57634,277,00043,351,0002,535,424
5Apr 21, 2026 15:29194,69596,810,58738,939,00038,939,0002,535,424
6Apr 21, 2026 15:29195,80297,606,18336,148,00042,173,0002,539,520
7Apr 21, 2026 15:29196,09296,208,07735,196,00043,241,0002,543,616
8Apr 21, 2026 15:29210,080105,322,05135,013,00049,019,0002,322,432
9Apr 21, 2026 15:29212,337100,798,13138,970,00045,965,0002,330,624