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 10:14limanjun99limanjun99Score: 79,522Success
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 10:1579,26549,318,08030,684,0001,022,0002,519,040
2Apr 24, 2026 10:1579,44251,798,25329,791,0001,986,0002,514,944
3Apr 24, 2026 10:1579,49046,351,90429,809,0001,987,0002,506,752
4Apr 24, 2026 10:1579,51553,875,67430,813,000993,0002,527,232
5Apr 24, 2026 10:1579,52249,322,85929,821,0001,988,0002,510,848
6Apr 24, 2026 10:1579,53251,841,45529,825,0001,988,0002,498,560
7Apr 24, 2026 10:1579,56249,300,59329,836,0001,989,0002,519,040
8Apr 24, 2026 10:1579,59247,849,55929,848,0001,989,0002,334,720
9Apr 24, 2026 10:1579,74549,974,80029,905,0001,993,0002,502,656