(2018 Multi-University Training Contest 3)Problem D. Euler Function
//题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6322
//题目大意:给定 k,求第 k 小的数 n,满足 φ(n) 是合数。显然 φ(1) = 1 不是合数,只考虑 n ≥ 2 的情况。
//思路:得到题意之后,查到了一张表(https://en.wikipedia.org/wiki/Euler%27s_totient_function)
//得知当且仅当 n = 1, 2, 3, 4, 6 时,φ(n) 不是合数。第1小的K值是5,第二小的K值是7,第n(n>=3)小则是n+5;

AC代码:
#include <bits/stdc++.h>
using namespace std;
int main()
{
int T;
scanf("%d",&T);
while(T--)
{
int n;
scanf("%d",&n);
if(n==)
cout<<<<endl;
else if(n==)
cout<<<<endl;
else
{
cout<<n+<<endl;
}
}
}
(2018 Multi-University Training Contest 3)Problem D. Euler Function的更多相关文章
- (2018 Multi-University Training Contest 2)Problem G - Naive Operations
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6315 题目大意:告诉你a,b两个数组,a数组初始化为0,b数组告诉你长度和具体值,接下来有q次操作,a ...
- (2018 Multi-University Training Contest 3)Problem L. Visual Cube
//题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6330//题目大意:按照一定格式画出一个 a×b×c 的长方体. #include <b ...
- ( 2018 Multi-University Training Contest 2)
2018 Multi-University Training Contest 2) HDU 6311 Cover HDU 6312 Game HDU 6313 Hack It HDU 6314 Mat ...
- HDU 5726 GCD (2016 Multi-University Training Contest 1)
Time Limit: 5000MS Memory Limit: 65536KB 64bit IO Format: %I64d & %I64u Description Give y ...
- HDU4888 Redraw Beautiful Drawings(2014 Multi-University Training Contest 3)
Redraw Beautiful Drawings Time Limit: 3000/1500 MS (Java/Others) Memory Limit: 65536/65536 K (Jav ...
- HDU 4897 Little Devil I(树链剖分)(2014 Multi-University Training Contest 4)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4897 Problem Description There is an old country and ...
- HDU 4906 Our happy ending(2014 Multi-University Training Contest 4)
题意:构造出n个数 这n个数取值范围0-L,这n个数中存在取一些数之和等于k,则这样称为一种方法.给定n,k,L,求方案数. 思路:装压 每位 第1为表示这种方案能不能构成1(1表示能0表示不能) ...
- Jquery动态设置下拉框selected --(2018 08/12-08/26周总结)
1.Jquery动态根据内容设置下拉框selected 需求就是根据下拉框的值动态的设置为selected,本以为很简单,网上一大推的方法,挨着尝试了之后却发现没有一个是有用的.网上的做法如下: &l ...
- 2017 Multi-University Training Contest - Team 1 1006&&HDU 6038 Function【DFS+数论】
Function Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total ...
随机推荐
- js随机数的取整
- 上下文调用(call , apply , bind)
var arr = []; var obj = { '0':'零', '1':'一', 'a':'sdsd', length : 2 } console.log( arr.push.call(obj, ...
- HTML和CSS查缺补漏
margin的问题: 1.margin-top向上传递 解决:1.父元素border边框,2.父元素使用overflow:hidden 3.为父元素或者子元素声明绝对定位,4.为父元素或者子元素声明浮 ...
- [Linux]最新sublime text 3显示图标
sublime text 3显示图标 执行命令 sudo vim /usr/share/applications/sublime_text_3.desktop 添加相应信息 [Desktop Entr ...
- python函数注释,参数后面加冒号:,函数后面的箭头→是什么?
https://blog.csdn.net/sunt2018/article/details/83022493
- [大数据面试题]hadoop核心知识点
* 面试答案为LZ所写,如需转载请注明出处,谢谢. * 这里不涉及HiveSQL和HBase操作的笔试题,这些东西另有总结. 1.MR意义. MR是一个用于处理大数据的分布式离线计算框架,它采用”分而 ...
- Nginx缓存
一.基于proxy_cache的缓存 worker_processes ; events { worker_connections ; } http { include mime.types; def ...
- jmeter的安装和配置
jmeter环境配置 Java 8 安装 正常安装,一路默认就好,记住安装路径,配置环境变量时用得到.默认安装路径:C:\Program Files\Java\jdk1.8.0_91. 安装好之后会有 ...
- 搭建Python自动化测试环境+元素定位
https://blog.csdn.net/GitChat/article/details/79081187
- sql group by聚合函数
如何让分组后count计算结果为0的记录也显示