Python, dp
python\nfrom functools import lru_cache\nclass Solution:\n    def poorPigs(self, buckets: int, minutesToDie: int, minutesToTest: int) -> int:\n        # f(n, t)
```python\nfrom functools import lru_cache\nclass Solution:\n    def poorPigs(self, buckets: int, minutesToDie: int, minutesToTest: int) -> int:\n        # f(n, t): the maximum number that can be recognized for n pigs with t tests\n        # f(0, t) = 1\n        # f(n, 0) = 1\n        # f(n, t) = sum{c(n, k) * f(n-k, t-1) for all 0 <= k <= n}\n\n        n_test = minutesToTest // minutesToDie\n        \n        @lru_cache(None)\n        def f(n, t):\n            if t == 0:\n                return 1\n            if n == 0:\n                return 1\n            \n            res = 0\n            comb = 1\n            for k in range(n+1):\n                res += comb * f(n-k, t-1)\n                comb *= n-k\n                comb //= k+1\n            return res\n        n = 0\n        while f(n, n_test) < buckets:\n            n += 1\n        return n\n```
[]