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 5, 2026 13:00Victor MerckléVictor MerckléScore: 18,977Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 5, 2026 13:037,31220,119,1112,925,00002,367,488
2May 5, 2026 13:038,21220,070,0193,285,00002,359,296
3May 5, 2026 13:038,75717,411,0153,503,00002,367,488
4May 5, 2026 13:0317,16520,459,1446,866,00002,371,584
5May 5, 2026 13:0318,97722,099,3027,591,00002,375,680
6May 5, 2026 13:0319,16027,742,2307,664,00002,375,680
7May 5, 2026 13:0319,26021,449,9977,704,00002,379,776
8May 5, 2026 13:0319,41022,642,1016,695,0001,069,0002,371,584
9May 5, 2026 13:0319,64221,239,8877,857,00002,355,200