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 29, 2026 01:36Charles CabergsCharles CabergsScore: 89,710Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 29, 2026 01:3988,61254,013,11418,229,00017,216,0002,506,752
2Apr 29, 2026 01:3988,82252,328,78119,287,00016,242,0002,519,040
3Apr 29, 2026 01:3989,55753,554,34913,931,00021,892,0002,506,752
4Apr 29, 2026 01:3989,59050,628,10814,932,00020,904,0002,306,048
5Apr 29, 2026 01:3989,71056,833,47717,942,00017,942,0002,510,848
6Apr 29, 2026 01:3993,59253,792,21820,236,00017,201,0002,506,752
7Apr 29, 2026 01:3997,09054,791,41020,912,00017,924,0002,510,848
8Apr 29, 2026 01:3998,42755,651,54118,171,00021,200,0002,498,560
9Apr 29, 2026 01:39103,50761,154,10724,236,00017,167,0002,514,944