当前位置:网站首页>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;
}
边栏推荐
- BI技巧丨权限轴
- Introduction to polyfit software
- Pytest 可视化测试报告之 Allure
- The 15th youth informatics competition in Shushan District in 2019
- Add namespace declaration
- 【问题】druid报异常sql injection violation, part alway true condition not allow 解决方案
- HMM隐马尔可夫模型最详细讲解与代码实现
- Crawler (6) - Web page data parsing (2) | the use of beautifulsoup4 in Crawlers
- Jetpack Compose 教程
- Opencv functions and methods related to binary threshold processing are summarized for comparison and use
猜你喜欢
Stream流
Comment utiliser async awati asynchrone Task Handling au lieu de backgroundworker?
How to use async Awati asynchronous task processing instead of backgroundworker?
LM10丨余弦波动顺势网格策略
使用canal配合rocketmq监听mysql的binlog日志
node_exporter部署
SSRS筛选器的IN运算(即包含于)用法
一文掌握数仓中auto analyze的使用
FPGA时序约束分享01_四大步骤简述
Introduction to polyfit software
随机推荐
HDU 1097 A hard puzzle
明明的随机数
指定输出的字符集
Educational Codeforces Round 22 E. Army Creation
线上数据库迁移的几种方法
BI技巧丨权限轴
2014 Hefei 31st youth informatics Olympic Games (primary school group) test questions
反射(一)
升级智能开关,“零火版”、“单火”接线方式差异有多大?
The difference and usage between substr (), slice (), and substring () in the string interception methods of "understand series after reading"
socket编程demo二
Some thoughts on whether the judgment point is located in the contour
"Only one trip", active recommendation and exploration of community installation and maintenance tasks
Shell programming core technology "four"
使用canal配合rocketmq监听mysql的binlog日志
MySQL数据库基本操作-DDL | 黑马程序员
《工作、消费主义和新穷人》的微信读书笔记
Use canal and rocketmq to listen to MySQL binlog logs
Is it safe to open an account at Great Wall Securities? How to open an account when buying stocks
“只跑一趟”,小区装维任务主动推荐探索