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 27, 2026 00:46Charles CabergsCharles CabergsScore: 121,307Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 27, 2026 00:47111,79566,731,12422,359,00022,359,0002,510,848stderr
2Apr 27, 2026 00:47116,31764,763,56826,298,00020,229,0002,514,944stderr
3Apr 27, 2026 00:47120,46765,886,27629,113,00019,074,0002,510,848stderr
4Apr 27, 2026 00:47121,13266,617,87730,283,00018,170,0002,506,752stderr
5Apr 27, 2026 00:47121,30768,402,67331,338,00017,185,0002,506,752stderr
6Apr 27, 2026 00:47126,30770,148,94230,314,00020,209,0002,494,464stderr
7Apr 27, 2026 00:47128,33073,222,63632,208,00019,124,0002,519,040stderr
8Apr 27, 2026 00:47128,50768,322,07531,245,00020,158,0002,338,816stderr
9Apr 27, 2026 00:47129,24765,747,38731,815,00019,884,0002,334,720stderr