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 24, 2026 11:37Charles CabergsCharles CabergsScore: 169,087Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 24, 2026 11:38166,76291,699,16537,395,00029,310,0002,449,408stderr
2Apr 24, 2026 11:38168,01082,602,45931,094,00036,110,0002,465,792stderr
3Apr 24, 2026 11:38168,48086,967,87840,234,00027,158,0002,457,600stderr
4Apr 24, 2026 11:38168,72789,140,07634,249,00033,242,0002,449,408stderr
5Apr 24, 2026 11:38169,08791,710,35134,322,00033,313,0002,453,504stderr
6Apr 24, 2026 11:38169,39084,575,73738,860,00028,896,0002,375,680stderr
7Apr 24, 2026 11:38172,15089,587,46539,919,00028,941,0002,461,696stderr
8Apr 24, 2026 11:38173,40289,163,23142,220,00027,141,0002,449,408stderr
9Apr 24, 2026 11:38175,98584,187,05643,242,00027,152,0002,453,504stderr