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:22Victor MerckléVictor MerckléScore: 11,592Success
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:234,98530,500,03401,994,0002,129,920stderr
2Aug 15, 2026 21:235,99531,021,31302,398,0002,129,920stderr
3Aug 15, 2026 21:236,14031,279,43902,456,0002,129,920stderr
4Aug 15, 2026 21:238,37031,392,8891,674,0001,674,0002,129,920stderr
5Aug 15, 2026 21:2311,59232,688,9742,194,0002,443,0002,129,920stderr
6Aug 15, 2026 21:2317,10035,222,7133,420,0003,420,0002,129,920stderr
7Aug 15, 2026 21:2319,09735,865,2673,819,0003,820,0002,129,920stderr
8Aug 15, 2026 21:2319,29035,850,0413,858,0003,858,0002,129,920stderr
9Aug 15, 2026 21:2319,54736,739,9303,910,0003,909,0002,129,920stderr