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:21A_ShamanA_ShamanScore: 1,089,212Success
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:231,066,970435,967,719414,959,00011,829,0002,113,536
2Jun 21, 2026 18:231,068,967437,241,243414,890,00012,697,0002,113,536
3Jun 21, 2026 18:231,071,565437,763,219417,045,00011,581,0002,113,536
4Jun 21, 2026 18:231,086,382443,852,262422,979,00011,574,0002,113,536
5Jun 21, 2026 18:231,089,212445,378,809422,895,00012,790,0002,113,536
6Jun 21, 2026 18:231,098,780449,184,049427,019,00012,493,0002,113,536
7Jun 21, 2026 18:231,100,897450,927,899427,804,00012,555,0002,113,536
8Jun 21, 2026 18:231,101,497449,882,785428,168,00012,431,0002,113,536
9Jun 21, 2026 18:231,101,662449,861,719429,099,00011,566,0002,113,536