I Count Tow Three
#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;
}
最新文章
- 吉特仓库管理系统-.NET打印问题总结
- cocos2d-x 常用UI
- 转:Configure your eclipse for C++
- 基于 REST 的 Web 服务:基础
- linux rc.sysinit文件详解
- SharePoint 2010 中创建超链接到Pop-Up对话框
- 正则API
- IntelliJ IDEA环境配置
- 章节十、6-CSS---用CSS 定位子节点
- 使用genism训练词向量【转载】
- Redis 的安装 使用 通知事件
- 在HTML中用循环语句
- CentOS 7使用yum安装MYSQL
- topcoder srm 712 div1
- Android自定义View学习(四)
- System.net.mail 腾讯ssl发送邮件超时
- AppBox下调用HighCharts画曲线
- docker问题
- gcc 与 g++的区分较
- 【Hadoop】用web查看hadoop运行状态