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 20, 2026 12:39Dominique GarmierDominique GarmierScore: 82,170Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 20, 2026 12:4153,17248,530,96319,244,0002,025,0002,486,272
2Apr 20, 2026 12:4159,69251,504,82621,888,0001,989,0002,265,088
3Apr 20, 2026 12:4161,90542,414,73622,781,0001,981,0002,273,280
4Apr 20, 2026 12:4167,41253,181,98224,968,0001,997,0002,285,568
5Apr 20, 2026 12:4182,17065,487,81831,872,000996,0002,494,464
6Apr 20, 2026 12:4182,40260,334,96430,964,0001,997,0002,486,272
7Apr 20, 2026 12:4183,01557,284,89632,200,0001,006,0002,322,432
8Apr 20, 2026 12:4184,26562,195,50332,685,0001,021,0002,478,080
9Apr 20, 2026 12:4184,59261,554,19131,847,0001,990,0002,490,368