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 13:29Victor MerckléVictor MerckléScore: 3,671,775Success
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 13:303,668,2901,491,211,0801,463,318,0003,998,0002,326,528stderr
2Apr 27, 2026 13:303,668,6301,482,065,4411,463,454,0003,998,0002,379,776stderr
3Apr 27, 2026 13:303,669,8671,484,792,2891,464,950,0002,997,0002,330,624stderr
4Apr 27, 2026 13:303,670,3151,489,141,6371,466,128,0001,998,0002,379,776stderr
5Apr 27, 2026 13:303,671,7751,491,453,0471,467,711,000999,0002,392,064stderr
6Apr 27, 2026 13:303,674,6071,491,189,9381,468,844,000999,0002,379,776stderr
7Apr 27, 2026 13:303,682,7051,492,491,5951,471,084,0001,998,0002,383,872stderr
8Apr 27, 2026 13:303,683,1401,493,305,7921,470,258,0002,998,0002,392,064stderr
9Apr 27, 2026 13:303,684,2101,495,527,4611,472,685,000999,0002,383,872stderr