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 23:51Charles CabergsCharles CabergsScore: 170,922Success
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 23:52167,02282,338,82334,900,00031,909,0002,457,600stderr
2Apr 24, 2026 23:52167,56286,440,38340,015,00027,010,0002,514,944stderr
3Apr 24, 2026 23:52169,87584,601,05034,974,00032,976,0002,453,504stderr
4Apr 24, 2026 23:52170,89590,047,91238,200,00030,158,0002,449,408stderr
5Apr 24, 2026 23:52170,92283,954,94840,217,00028,152,0002,457,600stderr
6Apr 24, 2026 23:52173,67785,585,61140,273,00029,198,0002,449,408stderr
7Apr 24, 2026 23:52177,07090,667,98046,886,00023,942,0002,469,888stderr
8Apr 24, 2026 23:52177,35086,559,87744,962,00025,978,0002,449,408stderr
9Apr 24, 2026 23:52179,12287,689,54337,338,00034,311,0002,457,600stderr