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 23, 2026 10:33Charles CabergsCharles CabergsScore: 163,022Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 23, 2026 10:34160,95580,002,26739,233,00025,149,0002,531,328
2Apr 23, 2026 10:34161,52784,540,67626,248,00038,363,0002,535,424
3Apr 23, 2026 10:34161,93282,750,57032,885,00031,888,0002,539,520
4Apr 23, 2026 10:34162,44785,595,91727,991,00036,988,0002,527,232
5Apr 23, 2026 10:34163,02284,827,60336,116,00029,093,0002,535,424
6Apr 23, 2026 10:34163,72585,888,93531,234,00034,256,0002,535,424
7Apr 23, 2026 10:34164,23089,822,89728,298,00037,394,0002,527,232
8Apr 23, 2026 10:34165,96082,508,73233,192,00033,192,0002,535,424
9Apr 23, 2026 10:34167,97089,188,31132,090,00035,098,0002,539,520