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 9, 2026 17:08Aleksei ShahoikaAleksei ShahoikaScore: 28,850Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 9, 2026 17:0926,66525,600,1709,594,0001,072,0002,367,488
2May 9, 2026 17:0928,65228,733,32410,331,0001,130,0002,359,296
3May 9, 2026 17:0928,78729,018,19110,466,0001,049,0002,367,488
4May 9, 2026 17:0928,79725,538,94210,471,0001,048,0002,363,392
5May 9, 2026 17:0928,85024,977,49710,491,0001,049,0002,363,392
6May 9, 2026 17:0928,99029,687,76510,542,0001,054,0002,351,104
7May 9, 2026 17:0929,15726,314,59710,593,0001,070,0002,355,200
8May 9, 2026 17:0929,22029,009,81710,598,0001,090,0002,359,296
9May 9, 2026 17:0929,40530,063,23910,626,0001,136,0002,363,392