51nod 1010 只包含因子2 3 5的数
2016-11-03 19:57
190 查看
#include <bits/stdc++.h> using namespace std; long long limit=(long long)1<<60; set<long long> st; set<long long> ::iterator it; int main() { long long T,n; st.insert(2); st.insert(3); st.insert(5); for(it=st.begin();*it<limit;it++) { st.insert((*it)*2); st.insert((*it)*3); st.insert((*it)*5); } cin>>T; while(T--) { scanf("%lld",&n); printf("%lld\n",*st.lower_bound(n)); } }
相关文章推荐
- 51Nod 1010 只包含因子2 3 5的数
- 【51nod】--1010 只包含因子2 3 5的数 (二分&&数论&&打表)
- 51nod 1010 只包含因子2 3 5的数(预处理+二分)
- 51nod 1010 只包含因子2 3 5的数
- 51nod 1010 只包含因子2 3 5的数
- 51nod-1010 只包含因子2 3 5的数
- 51Nod 1010 只包含因子2 3 5的数 打表+二分
- 51nod 1010 只包含因子2 3 5的数 && poj - 1338 Ugly Numbers(打表)
- 51nod 1010 只包含因子2 3 5的数
- 51nod:1010 只包含因子2 3 5的数
- 51nod 1010 只包含因子2 3 5的数
- 51nod-1010 只包含因子2 3 5的数
- 51Nod 1010 只包含因子2 3 5的数 | 预处理+二分
- 51nod 1010 只包含因子2 3 5的数 打表二分
- 51nod-1010 只包含因子2 3 5的数
- 51nod 1010 只包含因子2 3 5的数 (打表+二分)
- 51nod 1010 只包含因子2 3 5的数【打表+二分】
- 51Nod 1010 只包含因子2 3 5的数
- 51nod 1010 只包含因子2 3 5的数
- 51nod 1010 只包含因子2 3 5的数 打表