C++ solution with explanation
\nIf we can only test one round for 1000 buckets. We need to use 10 pigs( 2 ^ 10 = 1024 > 1000).\nWe can change 1 to 1000 to 10 bit binary format, such as\n1 = 
\nIf we can only test one round for 1000 buckets. We need to use 10 pigs( 2 ^ 10 = 1024 > 1000).\nWe can change 1 to 1000 to 10 bit binary format, such as\n1 = 000...001\n2 = 000...010\n3 = 000...011\nFrom right to left, if the bit is 1 we feed these buckets which binary format' 10th bit is 1 to pig 1. ( all event buckets which ends with 1 will be feed to piggy 1) \nFeed these buckets which 9th bit is 1 to piggy 2 as so on. Feed these 1st bit is 1 to piggy 10.\nIf the i-th piggy is dead, it means these buckets which i-th bit is 1 may contain poison and are feeding to the piggy.\nThen we check ten piggy and we obtain the 10 bit of buckets. \nPiggy 1st,      2nd, ....,9th,    10th, \nStatus Dead, Alive, ..., Dead, Alive\nBinary: 1,0, ..., 1, 0\n\nFor minutesToTest and minutesToDie. We can at most test minutesToTest/minutesToDie round. \nWe can change to buckets id to (t + 1) base.\nEg. 1000 = 5 ^ 6\n1st, 2nd, 3td, 4th, 5th\n4,   3,     4 , 2, 1\nFirst round, feed these these buckets which 1st bit is 4 to pig 1 and so on. The five pigs are feed with the buckets which i-th bit is 4.\nIf the i-th pig is die, it means the i-th bit of buckets is 4. Otherwise, the i-th pig will alive and the i-th bit of buckets may be 0,1,2,3. We can use the alive pigs to continue the test.\nFor the next round, feed these these buckets which 1st bit is 3 to alive pig 1 and so on. \nUtill the 4th round, we feed these buckets which 1st bit is 1 to alive pig and so on. \nSo the answer is:\n (t + 1) ^ ans = buckets\n\n```\nint poorPigs(int buckets, int minutesToDie, int minutesToTest) {\n        // need t round to test\n        // for t round we can use (t + 1) as base to express buckets\n        // for t = 4, 1000 = 5 ^ 6, 0, 1, 2, 3, 4 can test t round\n        //  (t + 1) ^ ans = buckets\n        int t = (minutesToTest - 1) / minutesToDie + 1;\n        if (buckets == 1) return 0;\n        return log(buckets - 1) / log(t + 1) + 1;\n    }\n```
[]