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 listMay 16, 2026 13:29M-RochatM-RochatError
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 16, 2026 13:30012,265,4981,579,00002,117,632expected "50", got "g160000 hd5ac8580cf6ac157 H3014184af6718906 r 7048/21 6998/19 6984/19 6963/29 7022/26 7024/23 6993/24 6968/24 7029/25 7030/26 6909/20 7038/20 7034/25 7034/27 6989/26 7004/25 c 8 14 13 12 13 10 11 13 8 13 13 12 12 11 10 11 14 10 11 1...
2May 16, 2026 13:30010,222,8071,696,00002,117,632expected "50", got "g160000 hc06c5ba9dc200538 H57f19181f0693446 r 6953/21 7011/24 7044/26 6977/25 6974/22 6922/25 6960/18 6984/25 7062/22 6938/20 6983/23 7083/35 7017/25 7041/18 6995/46 6965/47 c 12 12 10 14 11 11 13 12 12 14 12 14 9 13 14 10 13 7 11 1...
3May 16, 2026 13:30010,203,9861,678,00002,117,632expected "56", got "g160000 h962d9d1eec19c9c6 Hce28c179b4849d61 r 6918/25 6985/25 6983/22 7071/19 6942/27 6974/21 6995/22 7110/24 7044/30 7014/21 7032/21 7122/27 6900/21 7006/23 6984/25 7044/29 c 12 11 13 12 11 12 11 10 11 15 12 8 10 12 12 12 10 11 10 ...