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 21, 2026 19:26Charles CabergsCharles CabergsScore: 176,942Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 21, 2026 19:27174,09587,689,92936,333,00033,305,0002,469,888
2Apr 21, 2026 19:27174,91088,280,61832,983,00036,981,0002,375,680
3Apr 21, 2026 19:27175,51591,722,12829,085,00041,121,0002,379,776
4Apr 21, 2026 19:27175,86589,867,82332,158,00038,188,0002,383,872
5Apr 21, 2026 19:27176,94290,902,86434,890,00035,887,0002,375,680
6Apr 21, 2026 19:27177,05092,572,19733,914,00036,906,0002,375,680
7Apr 21, 2026 19:27191,66792,889,73937,325,00039,342,0002,355,200
8Apr 21, 2026 19:27191,83797,378,73831,890,00044,845,0002,531,328
9Apr 21, 2026 19:27193,09296,396,63839,120,00038,117,0002,531,328