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 19, 2026 01:08Charles CabergsCharles CabergsScore: 304,935Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 19, 2026 01:08300,543147,024,01673,132,00047,085,0002,338,816
2Apr 19, 2026 01:08302,345152,106,06259,969,00060,969,0002,416,640
3Apr 19, 2026 01:08304,630140,932,42662,924,00058,928,0002,310,144
4Apr 19, 2026 01:08304,913150,597,12362,982,00058,983,0002,482,176
5Apr 19, 2026 01:08304,935152,237,32264,986,00056,988,0002,334,720
6Apr 19, 2026 01:08306,763155,495,43159,856,00062,849,0002,338,816
7Apr 19, 2026 01:08307,198149,121,78661,939,00060,940,0002,428,928
8Apr 19, 2026 01:08307,210149,985,88765,938,00056,946,0002,523,136
9Apr 19, 2026 01:08310,703154,126,64869,156,00055,125,0002,510,848