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 30, 2026 01:40Charles CabergsCharles CabergsScore: 91,600Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 30, 2026 01:4189,47254,469,86918,889,00016,900,0002,461,696
2Apr 30, 2026 01:4190,03256,432,80321,008,00015,005,0002,482,176
3Apr 30, 2026 01:4190,91555,287,97418,183,00018,183,0002,535,424
4Apr 30, 2026 01:4191,15054,234,58414,179,00022,281,0002,465,792
5Apr 30, 2026 01:4191,60052,754,23019,338,00017,302,0002,531,328
6Apr 30, 2026 01:4191,79551,860,68315,299,00021,419,0002,465,792
7Apr 30, 2026 01:4192,41252,309,66217,983,00018,982,0002,465,792
8Apr 30, 2026 01:4196,17559,697,73016,198,00022,272,0002,486,272
9Apr 30, 2026 01:4198,22059,852,27120,148,00019,140,0002,494,464