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:55Victor MerckléVictor MerckléScore: 4,007,740Success
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:564,003,9351,620,232,5721,600,575,000999,0002,449,408stderr
2Apr 27, 2026 13:564,005,3171,623,373,3351,600,129,0001,998,0002,465,792stderr
3Apr 27, 2026 13:564,005,5071,619,108,3751,600,204,0001,999,0002,326,528stderr
4Apr 27, 2026 13:564,006,8301,623,157,9481,601,733,000999,0002,387,968stderr
5Apr 27, 2026 13:564,007,7401,625,276,6141,601,098,0001,998,0002,326,528stderr
6Apr 27, 2026 13:564,008,1801,620,823,1531,602,273,000999,0002,383,872stderr
7Apr 27, 2026 13:564,009,7101,625,721,5501,602,885,000999,0002,326,528stderr
8Apr 27, 2026 13:564,009,7921,625,702,3791,602,918,000999,0002,326,528stderr
9Apr 27, 2026 13:564,010,5551,624,885,0601,603,223,000999,0002,465,792stderr