用了优先队列,还是超时
class Solution { public: int nthSuperUglyNumber(int n, vector<int>& primes) { priority_queue<int,std::vector<int>,std::greater<int> > pq; pq.push(1); int i=1; int t; while(i<=n){ if(t == pq.top()) { pq.pop(); continue; } t=pq.top(); pq.pop(); for(auto k:primes) pq.push(t*k); i++; // cout<<t<<" "; } return t; } };