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 24, 2026 08:20limanjun99limanjun99Score: 769,265Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 24, 2026 08:23768,927324,045,752306,570,0001,001,0002,502,656
2Apr 24, 2026 08:23769,180329,149,982305,675,0001,997,0002,519,040
3Apr 24, 2026 08:23769,250328,300,116305,702,0001,998,0002,342,912
4Apr 24, 2026 08:23769,260325,071,598305,706,0001,998,0002,502,656
5Apr 24, 2026 08:23769,265324,023,637305,708,0001,998,0002,506,752
6Apr 24, 2026 08:23769,352322,950,793305,743,0001,998,0002,519,040
7Apr 24, 2026 08:23769,435326,645,840305,776,0001,998,0002,519,040
8Apr 24, 2026 08:23769,475328,083,789305,792,0001,998,0002,510,848
9Apr 24, 2026 08:23769,505325,954,460305,804,0001,998,0002,510,848