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 listJul 2, 2026 11:40A_ShamanA_ShamanScore: 1,172,460Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 2, 2026 11:421,169,117476,997,245446,804,00020,843,0002,113,536
2Jul 2, 2026 11:421,170,402477,600,575447,466,00020,695,0002,113,536
3Jul 2, 2026 11:421,171,642479,313,306447,851,00020,806,0002,113,536
4Jul 2, 2026 11:421,172,345478,239,707448,017,00020,921,0002,113,536
5Jul 2, 2026 11:421,172,460478,388,864448,163,00020,821,0002,113,536
6Jul 2, 2026 11:421,173,350478,788,346448,564,00020,776,0002,113,536
7Jul 2, 2026 11:421,174,002479,725,382447,925,00021,676,0002,113,536
8Jul 2, 2026 11:421,174,017479,005,237448,775,00020,832,0002,113,536
9Jul 2, 2026 11:421,175,070479,452,851449,415,00020,613,0002,113,536