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 1, 2025 11:28AnSaAnSaScore: 9,422,288Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 1, 2025 11:289,111,6933,671,586,6343,605,692,00038,985,0002,498,560
2Oct 1, 2025 11:289,253,3883,731,185,3953,662,373,00038,982,0002,457,600
3Oct 1, 2025 11:289,284,4153,742,767,2143,662,783,00050,983,0002,478,080
4Oct 1, 2025 11:289,309,5233,746,824,2963,679,835,00043,974,0002,445,312
5Oct 1, 2025 11:289,422,2883,791,623,5653,716,944,00051,971,0002,498,560
6Oct 1, 2025 11:289,500,9203,829,980,5333,757,387,00042,981,0002,400,256
7Oct 1, 2025 11:289,543,8983,845,434,3413,767,591,00049,968,0002,404,352
8Oct 1, 2025 11:289,586,2483,862,255,9953,792,516,00041,983,0002,490,368
9Oct 1, 2025 11:289,592,3683,866,262,5753,785,975,00050,972,0002,359,296