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 listFeb 21, 2026 02:30olliecrowolliecrowScore: 352,905Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Feb 21, 2026 02:30351,920164,272,261135,777,0004,991,0002,437,120
2Feb 21, 2026 02:30352,248172,378,583133,904,0006,995,0002,498,560
3Feb 21, 2026 02:30352,373165,886,038137,951,0002,998,0002,392,064
4Feb 21, 2026 02:30352,765168,558,990135,102,0006,004,0002,363,392
5Feb 21, 2026 02:30352,905172,340,783134,154,0007,008,0002,281,472
6Feb 21, 2026 02:30389,918180,728,776151,968,0003,999,0002,387,968
7Feb 21, 2026 02:30396,913182,859,551154,771,0003,994,0002,383,872
8Feb 21, 2026 02:30460,033219,277,143179,013,0005,000,0002,363,392
9Feb 21, 2026 02:30466,613213,491,878180,657,0005,988,0002,379,776