标签:class 因子 一个 http res nbsp ret public style
class Solution { public: int GetUglyNumber_Solution(int index) { if (index < 7) return index; vector<int> res(index); res[0] = 1; int in2 = 0, in5 = 0, in3 = 0; for (int i = 1; i < index; i++) { res[i] = min(res[in2] * 2, min(res[in3] * 3, res[in5] * 5)); if (res[i] == res[in2] * 2) in2++; if (res[i] == res[in3] * 3) in3++; if (res[i] == res[in5] * 5) in5++; } return res[index - 1]; } };
标签:class 因子 一个 http res nbsp ret public style
原文地址:https://www.cnblogs.com/ruoh3kou/p/10125337.html