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 listOct 2, 2025 06:35AnSaAnSaScore: 6,324,290Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 2, 2025 06:356,095,0632,467,602,8522,436,027,0001,998,0002,277,376
2Oct 2, 2025 06:356,115,7752,472,675,5202,445,311,000999,0002,277,376
3Oct 2, 2025 06:356,255,5152,528,273,0542,500,208,0001,998,0002,277,376
4Oct 2, 2025 06:356,314,9982,552,906,4982,525,999,00002,285,568
5Oct 2, 2025 06:356,324,2902,553,719,3042,527,718,0001,998,0002,285,568
6Oct 2, 2025 06:356,418,2002,599,333,4342,566,281,000999,0002,265,088
7Oct 2, 2025 06:356,425,0302,595,941,5482,569,013,000999,0002,277,376
8Oct 2, 2025 06:356,631,8082,677,298,7262,650,724,0001,999,0002,260,992
9Oct 2, 2025 06:356,699,3902,702,532,2952,678,757,000999,0002,269,184