r**********g 发帖数: 22734 | 1 还没解。可能没啥意思。
福特密码锁解锁需要有五个数字,但是你可以连续输入,只要你输入的数字串含有密码
子串就可以开锁。例如密码是11234
输入 00011112112345112也可以解锁。
问至少输入几次可以保证解锁。 |
M*********n 发帖数: 4839 | 2 这个是个backtracking吧?
原理上每次改变一个字母,可以回到原点,并包括所有的组合。 |
h****t 发帖数: 69 | 3 10^5 + (5-1) = 100004
Every substring of length 5 of a De Bruijn sequence is unique and appears
exactly once
You are not planning to use this as an interview question are you? |
r**********g 发帖数: 22734 | 4 No just bought a ford, random thoughts. |
r**********g 发帖数: 22734 | 5 Sounds insecure. Because two numbers are grouped as one key, so about 5^5
key presses can unlock it. About 3000...
【在 h****t 的大作中提到】 : 10^5 + (5-1) = 100004 : Every substring of length 5 of a De Bruijn sequence is unique and appears : exactly once : You are not planning to use this as an interview question are you?
|
h****t 发帖数: 69 | 6 Oh, I thought the allowed characters are 0-9, if it's 0-4, then yeah it's 5^
5 + 4 |