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 listSep 10, 2026 14:21Andrew EpsteinAndrew EpsteinScore: 5,542Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 10, 2026 14:265,28212,003,8141,075,0001,038,0002,121,728stderr
2Sep 10, 2026 14:265,33512,016,1241,108,0001,026,0002,121,728stderr
3Sep 10, 2026 14:265,36511,962,2781,123,0001,023,0002,121,728stderr
4Sep 10, 2026 14:265,50712,051,5591,174,0001,029,0002,121,728stderr
5Sep 10, 2026 14:265,54212,193,6322,217,00002,121,728stderr
6Sep 10, 2026 14:265,56512,105,4361,200,0001,026,0002,121,728stderr
7Sep 10, 2026 14:265,58212,037,4321,208,0001,025,0002,121,728stderr
8Sep 10, 2026 14:265,63012,820,3361,219,0001,033,0002,121,728stderr
9Sep 10, 2026 14:265,68712,149,3651,240,0001,035,0002,121,728stderr