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 2, 2026 12:44A_ShamanA_ShamanScore: 403,335Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 2, 2026 12:47403,230170,646,870160,268,0001,024,0002,113,536
2Jul 2, 2026 12:47403,240170,652,976160,282,0001,014,0002,113,536
3Jul 2, 2026 12:47403,267170,587,974160,296,0001,011,0002,113,536
4Jul 2, 2026 12:47403,290170,642,008160,300,0001,016,0002,113,536
5Jul 2, 2026 12:47403,335170,732,351160,259,0001,075,0002,113,536
6Jul 2, 2026 12:47403,350170,664,861160,285,0001,055,0002,113,536
7Jul 2, 2026 12:47403,410172,390,532160,337,0001,027,0002,113,536
8Jul 2, 2026 12:47406,695172,058,049161,641,0001,037,0002,113,536
9Jul 2, 2026 12:47407,725172,473,387162,082,0001,008,0002,113,536