UVALive 5987
求第n个数,该数满足至少由3个不同的素数的乘机组成
#include
#include
#include
#include
#include
using namespace std;
int prim[5000];
int ans[5000];
int cnt1,cnt2;
void getvis(){
cnt1=-1;
for(int i=2;i=3){
ans[++cnt2]=i;
}
}
}
int main(){
int t;
scanf("%d",&t);
getvis();
getans();
while(t--){
int n;
scanf("%d",&n);
printf("%d\n",ans[n-1]);
}
return 0;
}
UVALive 5987的更多相关文章
- UVALIve 5987 素数
题目链接:Distinct Primes 如果一个数.至少有三个因子是素数..那么这个数就是prime num.30和42是前两个prime num.问你第n个这种数是谁.(1<=n<=1 ...
- UVALive - 4108 SKYLINE[线段树]
UVALive - 4108 SKYLINE Time Limit: 3000MS 64bit IO Format: %lld & %llu Submit Status uDebug ...
- UVALive - 3942 Remember the Word[树状数组]
UVALive - 3942 Remember the Word A potentiometer, or potmeter for short, is an electronic device wit ...
- UVALive - 3942 Remember the Word[Trie DP]
UVALive - 3942 Remember the Word Neal is very curious about combinatorial problems, and now here com ...
- 思维 UVALive 3708 Graveyard
题目传送门 /* 题意:本来有n个雕塑,等间距的分布在圆周上,现在多了m个雕塑,问一共要移动多少距离: 思维题:认为一个雕塑不动,视为坐标0,其他点向最近的点移动,四舍五入判断,比例最后乘会10000 ...
- UVALive 6145 Version Controlled IDE(可持久化treap、rope)
题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_ ...
- UVALive 6508 Permutation Graphs
Permutation Graphs Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit ...
- UVALive 6500 Boxes
Boxes Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit Status Pract ...
- UVALive 6948 Jokewithpermutation dfs
题目链接:UVALive 6948 Jokewithpermutation 题意:给一串数字序列,没有空格,拆成从1到N的连续数列. dfs. 可以计算出N的值,也可以直接检验当前数组是否合法. # ...
随机推荐
- http请求头和相应头的作用
请求头(Request Headers) Accept:application/json, text/plain, */* Accept-Encoding:gzip, deflate Accept-L ...
- bootstrapValidator 插件
1 有关内容:https://blog.csdn.net/u013938465/article/details/53507109 https://blog.csdn.net/wangtongxue12 ...
- window下部署yapi
YApi 是一个可本地部署的.打通前后端及QA的.可视化的接口管理平台. 环境要求 nodejs(尽量最新版本) mongodb(尽量最新版本) 1.安装node https://www.runoob ...
- C#继承机制 C#中的继承符合下列规则
1.继承是可传递的.如果C从B中派生,B又从A中派生,那么C不仅继承了B中声明的成员,同样也继承了A中的成员.Object 类作为所有类的基类. 2.派生类应当是对基类的扩展.派生类可以添加新的成员, ...
- 去除select下拉框默认样式
去除select下拉框默认样式 select { /*Chrome和Firefox里面的边框是不一样的,所以复写了一下*/ border: solid 1px #; /*很关键:将默认的select选 ...
- shell中字符串基本用法
前言 今天在写脚本时,发现前阶段使用过的一些用法还是需要去百度查找,并且找到的答案还需要自己去筛选,耽误写脚本时间,这一篇对字符串之间的比较和逻辑判断都非常详细,借鉴他人之作,资源共享. 本片主要说明 ...
- 怎样查看web软件例如apache的连接数
查看连接总数和当前的连接数 netstat -ant | grep $ip:80 | wc -l netstat -ant | grep $ip:80 | grep EST | wc -l 查看IP访 ...
- 使用cxf 发布 jax-rs 风格webservice 。并客户端测试。
详细介绍:http://www.ibm.com/developerworks/cn/java/j-lo-jaxrs/ 1.定义一个User对象 package com.zf.test; import ...
- OAuth2.0 social_django微博第三方登录
python网站第三方登录,social-auth-app-django模块, social-auth-app-django模块是专门用于Django的第三方登录OAuth2协议模块 目前流行的第三方 ...
- python3爬虫之Urllib库(一)
上一篇我简单说了说爬虫的原理,这一篇我们来讲讲python自带的请求库:urllib 在python2里边,用urllib库和urllib2库来实现请求的发送,但是在python3种在也不用那么麻烦了 ...