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 21:32Victor MerckléVictor MerckléScore: 17,710Success
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 21:357,715112,042,6911,543,0001,543,0002,117,632stderr
2Aug 15, 2026 21:3511,172112,564,1272,191,0002,278,0002,117,632stderr
3Aug 15, 2026 21:3516,792115,046,7433,264,0003,453,0002,117,632stderr
4Aug 15, 2026 21:3517,620116,019,1373,524,0003,524,0002,117,632stderr
5Aug 15, 2026 21:3517,710115,154,5613,410,0003,674,0002,117,632stderr
6Aug 15, 2026 21:3518,190115,425,4613,638,0003,638,0002,117,632stderr
7Aug 15, 2026 21:3518,267115,461,8283,654,0003,653,0002,117,632stderr
8Aug 15, 2026 21:3518,270115,619,8293,653,0003,655,0002,117,632stderr
9Aug 15, 2026 21:3518,435115,503,1533,686,0003,688,0002,117,632stderr