码迷,mamicode.com
首页 > 其他好文 > 详细

I Count Tow Three

时间:2018-08-02 01:58:39      阅读:113      评论:0      收藏:0      [点我收藏+]

标签:++   can   ring   不能   lower   str   set   --   mat   


#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<string>
#include<vector>
#include<stack>
#include<bitset>
#include<cstdlib>
#include<cmath>
#include<set>
#include<list>
#include<deque>
#include<map>
#include<queue>
using namespace std;
typedef long long ll;
const double PI = acos(-1.0);
const int INF = 1000000000;
const int maxn = 100005;

int main()
{
    int T;
    int n;
    int  d = 0;
    ll a[maxn];
    memset(a, 0, sizeof(a));
    for(int i = 0; i <= 32; i++)
        for(int j = 0; j <= 19; j++)
            for(int k = 0; k <= 12; k++)
                for(int l = 0; l <= 11; l++)
    {
        ll s = pow(2,i)*pow(3,j)*pow(5,k)*pow(7,l);
        if(s > 0 && s < 1e9+7)
            a[d++] = s;
        else break;
    }
    sort(a, a+d);
    cin >> T;
    while(T--)
    {

    scanf("%d",&n); // 大量输入, 不能用cin
    //  int x= *lower_bound(a,a+d,n); // lower_bound 要用引用;
    printf("%lld\n",*lower_bound(a,a+d,n));
  //  printf("%lld\n", x);

    }

    return 0;
}


I Count Tow Three

标签:++   can   ring   不能   lower   str   set   --   mat   

原文地址:https://www.cnblogs.com/mrh-acmer/p/9404549.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!