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 listApr 27, 2026 16:29Victor MerckléVictor MerckléScore: 8,190Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 27, 2026 16:307,77018,916,1011,036,0002,072,0002,523,136
2Apr 27, 2026 16:307,90722,188,4151,054,0002,109,0002,502,656
3Apr 27, 2026 16:308,02722,352,4971,070,0002,141,0002,519,040
4Apr 27, 2026 16:308,09218,373,5002,158,0001,079,0002,519,040
5Apr 27, 2026 16:308,19016,331,2712,184,0001,092,0002,322,432
6Apr 27, 2026 16:308,20720,626,4531,094,0002,189,0002,506,752
7Apr 27, 2026 16:308,25720,796,3682,202,0001,101,0002,572,288
8Apr 27, 2026 16:308,28721,329,9722,210,0001,105,0002,506,752
9Apr 27, 2026 16:308,28721,907,9142,210,0001,105,0002,514,944