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 28, 2026 08:09Victor MerckléVictor MerckléScore: 823,712Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 28, 2026 08:10822,922347,867,765328,169,0001,000,0002,490,368stderr
2Apr 28, 2026 08:10823,457348,927,384328,382,0001,001,0002,490,368stderr
3Apr 28, 2026 08:10823,642346,667,927327,461,0001,996,0002,498,560stderr
4Apr 28, 2026 08:10823,700345,306,996328,479,0001,001,0002,494,464stderr
5Apr 28, 2026 08:10823,712350,597,338327,489,0001,996,0002,502,656stderr
6Apr 28, 2026 08:10823,715350,539,579328,485,0001,001,0002,502,656stderr
7Apr 28, 2026 08:10823,767351,095,081328,506,0001,001,0002,494,464stderr
8Apr 28, 2026 08:10824,012351,405,401327,608,0001,997,0002,318,336stderr
9Apr 28, 2026 08:10824,645348,303,940327,859,0001,999,0002,498,560stderr