Largest Square Submatrix of all 1's NoSIMD_C#

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 listJan 1, 2026 07:26Josu San MartinJosu San MartinScore: 187,748Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jan 1, 2026 07:26187,38095,692,69362,960,00011,992,0002,420,736
2Jan 1, 2026 07:26187,54096,441,53561,013,00014,003,0002,416,640
3Jan 1, 2026 07:26187,695106,493,95263,066,00012,012,0002,420,736
4Jan 1, 2026 07:26187,72398,271,34558,069,00017,020,0002,420,736
5Jan 1, 2026 07:26187,74896,042,38653,070,00022,029,0002,408,448
6Jan 1, 2026 07:26188,018100,476,53260,166,00015,041,0002,531,328
7Jan 1, 2026 07:26188,66599,081,83565,404,00010,062,0002,420,736
8Jan 1, 2026 07:26188,870101,367,97360,439,00015,109,0002,531,328
9Jan 1, 2026 07:26188,910101,080,81055,414,00020,150,0002,408,448