#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的更多相关文章

  1. nodejs api 中文文档

    文档首页 英文版文档 本作品采用知识共享署名-非商业性使用 3.0 未本地化版本许可协议进行许可. Node.js v0.10.18 手册 & 文档 索引 | 在单一页面中浏览 | JSON格 ...

  2. C#中Length和Count的区别(个人观点)

    这篇文章将会很短...短到比你的JJ还短,当然开玩笑了.网上有说过Length和count的区别,都是很含糊的,我没有发现有 文章说得比较透彻的,所以,虽然这篇文章很短,我还是希望能留在首页,听听大家 ...

  3. [PHP源码阅读]count函数

    在PHP编程中,在遍历数组的时候经常需要先计算数组的长度作为循环结束的判断条件,而在PHP里面对数组的操作是很频繁的,因此count也算是一个常用函数,下面研究一下count函数的具体实现. 我在gi ...

  4. EntityFramework.Extended 实现 update count+=1

    在使用 EF 的时候,EntityFramework.Extended 的作用:使IQueryable<T>转换为update table set ...,这样使我们在修改实体对象的时候, ...

  5. 学习笔记 MYSQL报错注入(count()、rand()、group by)

    首先看下常见的攻击载荷,如下: select count(*),(floor(rand(0)*2))x from table group by x; 然后对于攻击载荷进行解释, floor(rand( ...

  6. count(*) 与count (字段名)的区别

    count(*) 查出来的是:结果集的总条数 count(字段名) 查出来的是: 结果集中'字段名'不为空的记录的总条数

  7. BZOJ 2588: Spoj 10628. Count on a tree [树上主席树]

    2588: Spoj 10628. Count on a tree Time Limit: 12 Sec  Memory Limit: 128 MBSubmit: 5217  Solved: 1233 ...

  8. [LeetCode] Count Numbers with Unique Digits 计算各位不相同的数字个数

    Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < 10n. Examp ...

  9. [LeetCode] Count of Range Sum 区间和计数

    Given an integer array nums, return the number of range sums that lie in [lower, upper] inclusive.Ra ...

随机推荐

  1. 优云软件又双叒通过CMMI ML3评估 , 研发和质量管理水平创新高

    2017年第三季度,SEI授权的主任评估师对优云软件研发中心进行了CMMI软件能力成熟度模型评估,优云软件顺利通过复评. 这是继2011年12月优云软件首次通过CMMI ML3级的评估认证以来,第二次 ...

  2. Python文件操作---正斜杠与反斜杠

    Python中的正斜杠与反斜杠 首先,"/"左倾斜是正斜杠,"\"右倾斜是反斜杠,可以记为:除号是正斜杠一般来说对于目录分隔符,Unix和Web用正斜杠/,Wi ...

  3. <<Sklearn 与 TensorFlow 机器学习实用指南>>

    地址 https://github.com/apachecn/hands-on-ml-zh 目录结构 零.前言 第一部分 机器学习基础 一.机器学习概览 二.一个完整的机器学习项目 三.分类 四.训练 ...

  4. mysql from dual插入实现不插入重复记录

    在mysql中插入一或者多条记录的时候,要求某个字段的值唯一,但是该字段没有添加唯一性索引,可用from dual解决. select * from (select '2015080109' a,2 ...

  5. mysql 查询优化杂谈

    一.把某些判断移动到应用层 我们需要在一张表里面删除某种类型的数据,大概的表结构类似这样: CREATE TABLE t ( id INT, tp ENUM ("t1", &quo ...

  6. Redis所支持的数据结构

    1.启动Redis2.Redis所支持的数据结构 2.1.Redis常用操作 2.2.String类型及操作 2.3.Hash类型及操作 2.4.List类型及操作 2.5.Set类型及操作 2.6. ...

  7. 爬虫解析库——BeautifulSoup

    解析库就是在爬虫时自己制定一个规则,帮助我们抓取想要的内容时用的.常用的解析库有re模块的正则.beautifulsoup.pyquery等等.正则完全可以帮我们匹配到我们想要住区的内容,但正则比较麻 ...

  8. 怎样使用EOS.JS的API

    https://medium.com/coinmonks/how-to-use-eosjs-api-1-770b037b22ad https://blog.csdn.net/mongo_node/ar ...

  9. 调用run与调用start的区别

    调用start的结果 package TestException; public class test1 { public static void main(String[] args) { // 3 ...

  10. jsp内置对象学习记录

    1.session,是一个会话保留在服务器端的对象(默认保留时间为30分钟),所以我们可以在session里面放用户信息以便后续的访问便利(缺点:cookie劫持,导致用户数据泄露).案例:(1)同个 ...