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;
}
I Count Tow Three的更多相关文章
- nodejs api 中文文档
文档首页 英文版文档 本作品采用知识共享署名-非商业性使用 3.0 未本地化版本许可协议进行许可. Node.js v0.10.18 手册 & 文档 索引 | 在单一页面中浏览 | JSON格 ...
- C#中Length和Count的区别(个人观点)
这篇文章将会很短...短到比你的JJ还短,当然开玩笑了.网上有说过Length和count的区别,都是很含糊的,我没有发现有 文章说得比较透彻的,所以,虽然这篇文章很短,我还是希望能留在首页,听听大家 ...
- [PHP源码阅读]count函数
在PHP编程中,在遍历数组的时候经常需要先计算数组的长度作为循环结束的判断条件,而在PHP里面对数组的操作是很频繁的,因此count也算是一个常用函数,下面研究一下count函数的具体实现. 我在gi ...
- EntityFramework.Extended 实现 update count+=1
在使用 EF 的时候,EntityFramework.Extended 的作用:使IQueryable<T>转换为update table set ...,这样使我们在修改实体对象的时候, ...
- 学习笔记 MYSQL报错注入(count()、rand()、group by)
首先看下常见的攻击载荷,如下: select count(*),(floor(rand(0)*2))x from table group by x; 然后对于攻击载荷进行解释, floor(rand( ...
- count(*) 与count (字段名)的区别
count(*) 查出来的是:结果集的总条数 count(字段名) 查出来的是: 结果集中'字段名'不为空的记录的总条数
- 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 ...
- [LeetCode] Count Numbers with Unique Digits 计算各位不相同的数字个数
Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < 10n. Examp ...
- [LeetCode] Count of Range Sum 区间和计数
Given an integer array nums, return the number of range sums that lie in [lower, upper] inclusive.Ra ...
随机推荐
- 20165225《Java程序设计》第五周学习总结
20165225<Java程序设计>第五周学习总结 1.视频与课本中的学习: - 第七章学习总结 内部类: 内部类的外嵌类的成员变量在内部类中仍然有效,内部类中的方法也可以调用外嵌类中的方 ...
- Nginx之基本介绍(一)
这是一篇介绍Nginx基本信息和配置文件详情的文章,适合入门者,如果你想深入了解Nginx请绕道 什么是Nginx? Nginx是轻量级,高性能,跨平台的web服务器 Nginx的特点 更快 单个请求 ...
- root用户远程登录Ubuntu
安装了一台Ubuntu的服务器,由于大家都需要使用,因此创建了多个用户,多台windows机器用过Putty远程登录,但是默认情况下创建的用户都是普通用户,也就是说很多root用户能够使用的权限以及命 ...
- env:bash \r解决
1.brew install dos2unix2.find . -type f -exec dos2unix {} \;
- (转)github设置添加SSH
很多朋友在用github管理项目的时候,都是直接使用https url克隆到本地,当然也有有些人使用 SSH url 克隆到本地.然而,为什么绝大多数人会使用https url克隆呢? 这是因为,使用 ...
- PHP MYSQL 临时表的使用
/** * 临时表:用于获取爱鸽登录分类数量 */ $temporaryTableName = uniqid('temporary_'); $model = M(); $model->execu ...
- 【Java】-NO.13.Algorithm.1.Java Algorithm.1.001-【Java 常用算法手册 】-
1.0.0 Summary Tittle:[Java]-NO.13.Algorithm.1.Java Algorithm.1.001-[Java 常用算法手册 ]- Style:Java Series ...
- Appium基础(二)demo
具体配置,请看上一篇 一.启动Android模拟 Start 打开如下界面:这个过程可能会有些慢,黑屏等等,请耐心等待 二.appium配置 1.点机器人图标 PlatformVersion 选19, ...
- ASP.Net Core 2.2 MVC入门到基本使用系列 (三)(转)
本教程会对基本的.Net Core 进行一个大概的且不会太深入的讲解, 在您看完本系列之后, 能基本甚至熟练的使用.Net Core进行Web开发, 感受到.Net Core的魅力. 本教程知识点大体 ...
- 在window下搭建Vue.Js开发环境
nodejs官网http://nodejs.cn/下载安装包,无特殊要求可本地傻瓜式安装,这里选择2017-5-2发布的 v6.10.3,也可选择阿里云镜像https://npm.taobao.org ...