Largest Square Submatrix of all 1's C#_user

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 listAug 15, 2026 15:52Victor MerckléVictor MerckléScore: 10,520Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Aug 15, 2026 15:545,64511,076,99602,258,0002,117,632stderr
2Aug 15, 2026 15:546,62711,511,19302,651,0002,117,632stderr
3Aug 15, 2026 15:546,66210,627,16802,665,0002,117,632stderr
4Aug 15, 2026 15:548,71011,622,1001,140,0002,344,0002,117,632stderr
5Aug 15, 2026 15:5410,52013,137,9291,404,0002,804,0002,117,632stderr
6Aug 15, 2026 15:5418,19515,436,7153,094,0004,184,0002,117,632stderr
7Aug 15, 2026 15:5419,47716,835,7733,339,0004,452,0002,117,632stderr
8Aug 15, 2026 15:5419,77716,024,6823,390,0004,521,0002,117,632stderr
9Aug 15, 2026 15:5420,68216,649,3473,546,0004,727,0002,117,632stderr