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 27, 2026 14:13Victor MerckléVictor MerckléScore: 388,200Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 27, 2026 14:15361,015165,487,080143,404,0001,002,0002,301,952
2Apr 27, 2026 14:15370,025168,676,082146,010,0002,000,0002,301,952
3Apr 27, 2026 14:15375,072168,271,546148,029,0002,000,0002,306,048
4Apr 27, 2026 14:15387,202175,078,818152,883,0001,998,0002,310,144
5Apr 27, 2026 14:15388,200177,350,884153,277,0002,003,0002,297,856
6Apr 27, 2026 14:15391,377181,224,749156,551,00002,330,624
7Apr 27, 2026 14:15398,625177,105,580158,448,0001,002,0002,297,856
8Apr 27, 2026 14:15411,480180,750,577163,589,0001,003,0002,560,000
9Apr 27, 2026 14:15429,505190,323,792169,805,0001,997,0002,314,240