2018HDU多校训练-3-Problem D. Euler Function
链接:http://acm.hdu.edu.cn/showproblem.php?pid=6322
For example, φ(9)=6
because 1,2,4,5,7
and 8
are coprime with 9
. As another example, φ(1)=1
since for n=1
the only integer in the range from 1
to n
is 1
itself, and gcd(1,1)=1
.
A composite number is a positive integer that can be formed by multiplying together two smaller positive integers. Equivalently, it is a positive integer that has at least one divisor other than 1
and itself. So obviously 1
and all prime numbers are not composite number.
In this problem, given integer k
, your task is to find the k
-th smallest positive integer n
, that φ(n)
is a composite number.
, denoting the number of test cases.
In each test case, there is only one integer k(1≤k≤109
)
.
1
2
7
#include<bits/stdc++.h>
using namespace std; int main()
{
int t;
long long k;
cin>>t;
while(t--)
{
cin>>k;
if(k==1) cout<<5<<endl;
else cout<<k+5<<endl;
}
return 0;
}
2018HDU多校训练-3-Problem D. Euler Function的更多相关文章
- HDU 6322.Problem D. Euler Function -欧拉函数水题(假的数论题 ̄▽ ̄) (2018 Multi-University Training Contest 3 1004)
6322.Problem D. Euler Function 题意就是找欧拉函数为合数的第n个数是什么. 欧拉函数从1到50打个表,发现规律,然后勇敢的水一下就过了. 官方题解: 代码: //1004 ...
- 2018HDU多校训练-3-Problem M. Walking Plan
链接:http://acm.hdu.edu.cn/showproblem.php?pid=6331 Walking Plan Problem Description There are n inte ...
- 2018HDU多校训练-3-Problem G. Interstellar Travel
链接:http://acm.hdu.edu.cn/showproblem.php?pid=6325 Interstellar Tra ...
- 2018HDU多校训练一 K - Time Zone
Chiaki often participates in international competitive programming contests. The time zone becomes a ...
- 2018HDU多校训练-3-Problem F. Grab The Tree
Little Q and Little T are playing a game on a tree. There are n vertices on the tree, labeled by 1,2 ...
- 2018HDU多校训练一 D Distinct Values
hiaki has an array of nn positive integers. You are told some facts about the array: for every two e ...
- 2018HDU多校训练一 C -Triangle Partition
Chiaki has 3n3n points p1,p2,-,p3np1,p2,-,p3n. It is guaranteed that no three points are collinear. ...
- 2018HDU多校训练一 A - Maximum Multiple
Given an integer nn, Chiaki would like to find three positive integers xx, yy and zzsuch that: n=x+y ...
- (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 ...
随机推荐
- css字体图标的制作
我介绍的这个办法是直接在 "阿里巴巴图标库"中制作的,方便快捷 1. 首先到 "阿里巴巴图标库"中找到你想要的图片,然后选择加入购物车 接着我们点击右上角的购物 ...
- java编程思想第四版第十八章总结
一.概述 如何学习java I/O 学习I/O类库 学习I/O发展史,为什么要学习发展史呢? 因为,如果缺乏发展史,我们就会对什么时候使用哪个类,以及什么时候不该使用它们而感到迷惑. 了解nio 二. ...
- poj 3974 Palindrome (manacher)
Palindrome Time Limit: 15000MS Memory Limit: 65536K Total Submissions: 12616 Accepted: 4769 Desc ...
- nyoj 95-众数问题 (map)
95-众数问题 内存限制:64MB 时间限制:3000ms 特判: No 通过数:16 提交数:29 难度:3 题目描述: 所谓众数,就是对于给定的含有N个元素的多重集合,每个元素在S中出现次数最多的 ...
- TreeMap树映射取出对象的方式
1.直接获取该TreeMap集合中的关系:entrySet() Map接口中的方法,返回值类型是该集合中的各个关系:返回值类型是:Set类型的Map.EntrySet类型:然后在通过Set集合中特有的 ...
- 从0开始学前端(笔记备份)----HTML部分 Day1 HTML标签
- 领扣(LeetCode)设计哈希映射 个人题解
不使用任何内建的哈希表库设计一个哈希映射 具体地说,你的设计应该包含以下的功能 put(key, value):向哈希映射中插入(键,值)的数值对.如果键对应的值已经存在,更新这个值. get(key ...
- BeautifulSoup随笔
BeautifulSoup是一个类 b = BeautifulSoup(html) b对象有与html结构相关的各种方法和和属性. a = b.findAll('a')获得标签的对象 a对象又有关于属 ...
- Entity Framework Core For MySql查询中使用DateTime.Now的问题
背景 最近一直忙于手上澳洲线上项目的整体迁移和升级的准备工作,导致博客和公众号停更.本周终于艰难的完成了任务,借此机会,总结一下项目中遇到的一些问题. EF Core一直是我们团队中中小型项目常用的O ...
- react antd Table动态合并单元格
示例数据 原始数组 const data = [ { key: '0', name: 'John Brown', age:22, address: 'New York No. 1 Lake Park' ...