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 18, 2026 01:01M-RochatM-RochatError
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 18, 2026 01:02017,861,2883,772,0001,075,0002,121,728expected "52", got "50 "
2May 18, 2026 01:0211,74215,667,2463,624,0001,073,0002,121,728
3May 18, 2026 01:0211,97716,971,0763,722,0001,069,0002,121,728
4May 18, 2026 01:0212,03015,636,2733,764,0001,048,0002,121,728
5May 18, 2026 01:0212,06716,648,4043,762,0001,065,0002,121,728
6May 18, 2026 01:0212,09716,216,3443,778,0001,061,0002,121,728
7May 18, 2026 01:0212,14715,874,7463,810,0001,049,0002,121,728
8May 18, 2026 01:0212,19714,350,4703,831,0001,048,0002,121,728
9May 18, 2026 01:0212,27517,165,8893,835,0001,075,0002,121,728