当前位置:网站首页>Euler function
Euler function
2022-07-04 19:36:00 【Acacia moon tower】
#include <iostream>
#include <cstdio>
using namespace std;
const int Max = 100000;
int euler[Max];
void Init(){
euler[1] = 1;
for(int i = 2; i < Max; i++) {
euler[i]=i;
}
for(int i = 2; i < Max; i++) {
if(euler[i] == i) {
for(int j = i; j < Max; j += i) {
euler[j]=euler[j]/i*(i-1);
}
}
}
}
int main() {
int n;
Init();
while(scanf("%d", &n) != EOF) {
printf("%d\n", euler[n]);
}
return 0;
}
边栏推荐
猜你喜欢
如何使用Async-Awati异步任务处理代替BackgroundWorker?
Bi skills - permission axis
Some thoughts on whether the judgment point is located in the contour
Master the use of auto analyze in data warehouse
使用canal配合rocketmq监听mysql的binlog日志
Explore the contour drawing function drawcontours() of OpenCV in detail with practical examples
Lenovo explains in detail the green smart city digital twin platform for the first time to solve the difficulties of urban dual carbon upgrading
大div中有多个div,这些div在同一行显示,溢出后产生滚动条而不换行
Comment utiliser async awati asynchrone Task Handling au lieu de backgroundworker?
更安全、更智能、更精致,长安Lumin完虐宏光MINI EV?
随机推荐
SSRS筛选器的IN运算(即包含于)用法
26. 删除有序数组中的重复项 C#解答
1011 World Cup Betting (20 分)(PAT甲级)
One question per day (2022-07-02) - Minimum refueling times
基于NCF的多模块协同实例
Reflection (I)
Unity编辑器扩展C#遍历文件夹以及子目录下的所有图片
QT realizes interface sliding switching effect
876. Intermediate node of linked list
更安全、更智能、更精致,长安Lumin完虐宏光MINI EV?
In flinksql, in addition to data statistics, is the saved data itself a state
牛客小白月赛7 I 新建 Microsoft Office Word 文档
欧拉函数
Unity editor extends C to traverse all pictures in folders and subdirectories
爬虫(6) - 网页数据解析(2) | BeautifulSoup4在爬虫中的使用
Bi skills - permission axis
LeetCode第300场周赛(20220703)
Summary and sorting of 8 pits of redis distributed lock
2014合肥市第三十一届青少年信息学奥林匹克竞赛(小学组)试题
LeetCode 赎金信 C#解答