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 19:25Victor MerckléVictor MerckléScore: 17,432Success
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 19:265,74711,095,73002,299,0002,117,632stderr
2Aug 15, 2026 19:269,59711,709,6421,274,0002,565,0002,117,632stderr
3Aug 15, 2026 19:2610,78712,212,3722,049,0002,266,0002,117,632stderr
4Aug 15, 2026 19:2613,03514,003,2682,607,0002,607,0002,117,632stderr
5Aug 15, 2026 19:2617,43214,849,7773,487,0003,486,0002,117,632stderr
6Aug 15, 2026 19:2617,72215,883,3533,545,0003,544,0002,117,632stderr
7Aug 15, 2026 19:2618,52016,692,8823,705,0003,703,0002,117,632stderr
8Aug 15, 2026 19:2618,80515,424,3973,761,0003,761,0002,117,632stderr
9Aug 15, 2026 19:2620,47516,994,6444,680,0003,510,0002,117,632stderr