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 13:44Victor MerckléVictor MerckléScore: 3,688,930Success
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 13:463,687,7151,494,919,6051,473,088,0001,998,0002,392,064stderr
2Apr 27, 2026 13:463,688,1971,495,402,1251,473,280,0001,999,0002,392,064stderr
3Apr 27, 2026 13:463,688,3271,497,597,2441,474,332,000999,0002,379,776stderr
4Apr 27, 2026 13:463,688,9021,496,781,5591,472,562,0002,999,0002,383,872stderr
5Apr 27, 2026 13:463,688,9301,491,497,5631,473,573,0001,999,0002,326,528stderr
6Apr 27, 2026 13:463,689,0921,500,203,9171,473,638,0001,999,0002,326,528stderr
7Apr 27, 2026 13:463,689,7321,493,937,9351,473,895,0001,998,0002,392,064stderr
8Apr 27, 2026 13:463,689,9851,493,373,8621,473,996,0001,998,0002,326,528stderr
9Apr 27, 2026 13:463,690,0301,492,202,5431,473,015,0002,997,0002,379,776stderr