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 12:35Victor MerckléVictor MerckléScore: 1,245,710Success
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 12:361,156,227479,454,653461,250,0001,241,0002,486,272stderr
2May 5, 2026 12:361,176,947487,066,608469,518,0001,261,0002,494,464stderr
3May 5, 2026 12:361,184,630488,760,832472,668,0001,184,0002,473,984stderr
4May 5, 2026 12:361,243,657517,099,927496,313,0001,150,0002,486,272stderr
5May 5, 2026 12:361,245,710514,587,414497,056,0001,228,0002,322,432stderr
6May 5, 2026 12:361,248,830516,916,989498,448,0001,084,0002,486,272stderr
7May 5, 2026 12:361,250,897517,543,824499,153,0001,206,0002,478,080stderr
8May 5, 2026 12:361,254,272517,803,756500,544,0001,165,0002,486,272stderr
9May 5, 2026 12:361,256,312517,363,425501,370,0001,155,0002,478,080stderr