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 17:37Charles CabergsCharles CabergsScore: 119,242Success
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 17:39116,59262,457,61134,471,00012,166,0002,514,944stderr
2Apr 29, 2026 17:39117,54065,861,92434,012,00013,004,0002,510,848stderr
3Apr 29, 2026 17:39118,22565,340,25829,179,00018,111,0002,412,544stderr
4Apr 29, 2026 17:39118,63762,453,41729,281,00018,174,0002,510,848stderr
5Apr 29, 2026 17:39119,24267,142,07325,836,00021,861,0002,523,136stderr
6Apr 29, 2026 17:39121,29566,062,70735,378,00013,140,0002,502,656stderr
7Apr 29, 2026 17:39129,12769,205,78139,498,00012,153,0002,523,136stderr
8Apr 29, 2026 17:39130,88771,623,43935,239,00017,116,0002,514,944stderr
9Apr 29, 2026 17:39135,14768,492,38534,037,00020,022,0002,519,040stderr