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 15, 2026 11:05Tomislav TunkovicTomislav TunkovicScore: 1,995Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Aug 15, 2026 11:061,9558,911,574782,000028,672stderr
2Aug 15, 2026 11:061,9729,442,779789,000028,672stderr
3Aug 15, 2026 11:061,9829,088,597793,000028,672stderr
4Aug 15, 2026 11:061,9878,905,763795,000028,672stderr
5Aug 15, 2026 11:061,9959,941,098798,000028,672stderr
6Aug 15, 2026 11:062,0678,980,060827,000028,672stderr
7Aug 15, 2026 11:062,0828,886,198833,000028,672stderr
8Aug 15, 2026 11:062,1779,069,293871,000028,672stderr
9Aug 15, 2026 11:062,3278,928,504931,000028,672stderr