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 29, 2026 14:50Charles CabergsCharles CabergsScore: 91,205Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 29, 2026 14:5289,87554,321,59919,972,00015,978,0002,510,848
2Apr 29, 2026 14:5289,89255,591,83021,974,00013,983,0002,514,944
3Apr 29, 2026 14:5290,11253,305,18617,021,00019,024,0002,510,848
4Apr 29, 2026 14:5291,17754,231,89722,288,00014,183,0002,494,464
5Apr 29, 2026 14:5291,20554,277,72916,214,00020,268,0002,514,944
6Apr 29, 2026 14:5291,87058,326,35616,884,00019,864,0002,514,944
7Apr 29, 2026 14:5293,08054,081,42521,132,00016,100,0002,334,720
8Apr 29, 2026 14:5294,76257,202,03919,950,00017,955,0002,465,792
9Apr 29, 2026 14:5299,41265,016,76223,859,00015,906,0002,469,888