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:42Victor MerckléVictor MerckléError
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:44012,297,7111,761,0001,760,0002,117,632expected "54", got "50 "stderr
2Aug 15, 2026 15:442,9429,264,5051,177,00002,117,632stderr
3Aug 15, 2026 15:442,9559,462,0961,182,00002,117,632stderr
4Aug 15, 2026 15:443,3879,602,7501,355,00002,117,632stderr
5Aug 15, 2026 15:443,7959,637,36601,518,0002,117,632stderr
6Aug 15, 2026 15:444,10210,453,61901,641,0002,117,632stderr
7Aug 15, 2026 15:444,95210,075,10901,981,0002,117,632stderr
8Aug 15, 2026 15:446,74011,446,8921,348,0001,348,0002,117,632stderr
9Aug 15, 2026 15:449,82212,123,0121,288,0002,641,0002,117,632stderr