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 listJul 16, 2026 20:58Oleg KovalovOleg KovalovScore: 1,648,385Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 16, 2026 21:011,629,832679,288,686531,340,000120,593,00094,208
2Jul 16, 2026 21:011,632,747680,715,271532,023,000121,076,00081,920
3Jul 16, 2026 21:011,642,605685,681,436532,120,000124,922,00077,824
4Jul 16, 2026 21:011,643,135684,597,411531,114,000126,140,00057,344
5Jul 16, 2026 21:011,648,385688,971,017531,271,000128,083,00090,112
6Jul 16, 2026 21:011,654,440687,305,681531,149,000130,627,00049,152
7Jul 16, 2026 21:011,655,197689,121,787531,816,000130,263,00045,056
8Jul 16, 2026 21:011,656,552691,106,383531,524,000131,097,00045,056
9Jul 16, 2026 21:012,477,6202,090,034,638597,061,000393,987,00061,440