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 28, 2026 11:56Charles CabergsCharles CabergsScore: 97,392Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 28, 2026 11:5795,29054,977,19721,064,00017,052,0002,465,792
2Apr 28, 2026 11:5796,00756,725,12920,212,00018,191,0002,457,600
3Apr 28, 2026 11:5796,26757,935,11518,240,00020,267,0002,465,792
4Apr 28, 2026 11:5796,67554,949,76922,388,00016,282,0002,457,600
5Apr 28, 2026 11:5797,39260,901,94018,979,00019,978,0002,465,792
6Apr 28, 2026 11:5797,60061,341,62324,025,00015,015,0002,457,600
7Apr 28, 2026 11:5797,76757,903,25320,055,00019,052,0002,457,600
8Apr 28, 2026 11:5797,87259,232,48521,080,00018,069,0002,359,296
9Apr 28, 2026 11:5797,96254,319,51623,109,00016,076,0002,433,024