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 24, 2026 09:14limanjun99limanjun99Error
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 26, 2026 16:470221,763,722201,760,0001,997,0002,342,912expected "82", got "1,1,2|2,1,11|3,2,12|4,3,13|5,4,4130|6,10,2773|7,11,2774|8,12,2775|9,15,2775|10,16,2776|11,17,2777|12,18,2778|13,19,2779|14,20,2780|15,21,2781|16,22,2782|17,23,2783|18,24,2784|19,25,2785|20,26,2786|21,27,2787|22,28,2788|23,29,2789|24...
2Apr 26, 2026 16:470220,752,856202,577,0001,002,0002,342,912expected "87", got "1,1,2|2,1,16|3,2,37|4,3,1443|5,4,3275|6,13,8845|7,14,8846|8,16,8832|9,18,8816|10,19,8817|11,20,8818|12,21,8819|13,22,8820|14,23,8821|15,24,8822|16,25,8823|17,26,8824|18,27,8825|19,28,8826|20,29,8827|21,30,8828|22,31,8829|23,32,8830|...
3Apr 26, 2026 16:470223,457,677201,759,0001,997,0002,478,080expected "50", got "2,1,3|3,2,8|4,3,362|5,4,4362|6,20,4486|7,21,4487|8,22,4488|9,24,4489|10,25,4490|11,26,4491|12,27,4492|13,28,4493|14,29,4494|15,30,4495|16,31,4496|17,32,4497|18,33,4498|19,34,4499|20,35,4500|21,36,4501|22,37,4502|23,38,4503|24,39,450...