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 listApr 24, 2026 11:06limanjun99limanjun99Score: 25,105Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 24, 2026 11:0724,86229,928,9237,956,0001,989,0002,519,040
2Apr 24, 2026 11:0724,88232,118,6987,963,0001,990,0002,519,040
3Apr 24, 2026 11:0725,07528,715,1778,024,0002,006,0002,342,912
4Apr 24, 2026 11:0725,10023,412,1898,032,0002,008,0002,527,232
5Apr 24, 2026 11:0725,10531,257,3328,034,0002,008,0002,510,848
6Apr 24, 2026 11:0725,10724,473,2308,035,0002,008,0002,523,136
7Apr 24, 2026 11:0725,14224,578,5029,052,0001,005,0002,523,136
8Apr 24, 2026 11:0725,14228,870,0668,046,0002,011,0002,519,040
9Apr 24, 2026 11:0725,15526,251,0178,050,0002,012,0002,342,912