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 listJun 2, 2025 14:04vahookvahookError
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Sep 4, 2026 18:31Victor Mercklé10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 4, 2026 18:3209,674,8051,147,00002,113,536expected "2", got "50 "
2Sep 4, 2026 18:3209,202,0611,207,00002,113,536expected "2", got "50 "
3Sep 4, 2026 18:3209,182,5971,212,00002,113,536expected "2", got "50 "
4Jun 2, 2025 14:032,97016,883,55401,188,0002,490,368
5Jun 2, 2025 14:032,99316,275,7791,197,00002,486,272
6Jun 2, 2025 14:043,33318,670,0641,333,00002,482,176
7Jun 2, 2025 14:033,73822,618,9481,495,00002,482,176
8Jun 2, 2025 14:033,79319,118,1751,517,00002,490,368
9Jun 2, 2025 14:033,80827,013,9281,523,00002,486,272
10Jun 2, 2025 14:043,84322,887,6361,537,00002,494,464
11Jun 2, 2025 14:033,84517,491,4391,538,00002,490,368
12Jun 2, 2025 14:043,85313,742,6371,541,00002,486,272
13Jun 2, 2025 14:033,86316,151,1821,545,00002,269,184
14Jun 2, 2025 14:033,87017,851,9281,548,00002,490,368
15Jun 2, 2025 14:034,07527,092,0411,630,00002,486,272