Largest Square Submatrix of all 1's C#_user

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 listAug 30, 2026 19:12Josu San MartinJosu San MartinScore: 30,585Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Aug 30, 2026 19:1330,41520,518,22012,166,00002,117,632
2Aug 30, 2026 19:1330,49720,468,67512,199,00002,117,632
3Aug 30, 2026 19:1330,53720,491,09612,215,00002,117,632
4Aug 30, 2026 19:1330,58228,306,25512,233,00002,117,632
5Aug 30, 2026 19:1330,58520,524,23612,234,00002,117,632
6Aug 30, 2026 19:1330,62020,560,47812,248,00002,117,632
7Aug 30, 2026 19:1330,90527,648,37512,362,00002,117,632
8Aug 30, 2026 19:1330,93220,683,86012,373,00002,117,632
9Aug 30, 2026 19:1330,93229,300,58911,344,0001,029,0002,117,632