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 11, 2026 11:38Victor MerckléVictor MerckléScore: 817,922Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 11, 2026 11:40817,607336,611,084325,995,0001,048,0002,117,632
2May 11, 2026 11:40817,735335,860,972325,980,0001,114,0002,117,632
3May 11, 2026 11:40817,772336,505,397326,029,0001,080,0002,117,632
4May 11, 2026 11:40817,797335,907,815326,099,0001,020,0002,117,632
5May 11, 2026 11:40817,922337,722,231326,076,0001,093,0002,117,632
6May 11, 2026 11:40817,950337,862,143326,079,0001,101,0002,117,632
7May 11, 2026 11:40818,072335,998,665326,143,0001,086,0002,117,632
8May 11, 2026 11:40818,107337,523,941326,145,0001,098,0002,117,632
9May 11, 2026 11:40823,555339,490,770326,362,0003,060,0002,117,632