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 listMay 16, 2026 13:39M-RochatM-RochatError
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 16, 2026 13:40018,452,9747,384,0002,119,0002,121,728expected "52", got "50 "
2May 16, 2026 13:4023,13721,017,7587,188,0002,067,0002,113,536
3May 16, 2026 13:4023,42219,486,3058,200,0001,169,0002,121,728
4May 16, 2026 13:4023,73220,568,7647,371,0002,122,0002,117,632
5May 16, 2026 13:4023,73518,800,3877,383,0002,111,0002,121,728
6May 16, 2026 13:4023,91020,855,8267,419,0002,145,0002,121,728
7May 16, 2026 13:4023,95518,606,5377,443,0002,139,0002,117,632
8May 16, 2026 13:4024,25519,573,5627,544,0002,158,0002,121,728
9May 16, 2026 13:4024,26723,077,4797,532,0002,175,0002,121,728