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 listJun 21, 2026 18:36A_ShamanA_ShamanScore: 995,447Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 21, 2026 18:37988,480405,945,653347,208,00048,184,0002,113,536
2Jun 21, 2026 18:37993,225414,383,132349,764,00047,526,0002,113,536
3Jun 21, 2026 18:37994,292407,397,398350,907,00046,810,0002,113,536
4Jun 21, 2026 18:37995,362407,456,516350,276,00047,869,0002,113,536
5Jun 21, 2026 18:37995,447408,697,420350,177,00048,002,0002,113,536
6Jun 21, 2026 18:37995,902407,639,370350,772,00047,589,0002,113,536
7Jun 21, 2026 18:37996,897408,045,965351,882,00046,877,0002,113,536
8Jun 21, 2026 18:37998,700408,803,737351,600,00047,880,0002,113,536
9Jun 21, 2026 18:371,002,272410,594,646353,364,00047,545,0002,113,536