当前位置:网站首页>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;
}
边栏推荐
- Educational Codeforces Round 22 E. Army Creation
- 与二值化阈值处理相关的OpenCV函数、方法汇总,便于对比和拿来使用
- Oracle with as ORA-00903: invalid table name 多表报错
- 【问题】druid报异常sql injection violation, part alway true condition not allow 解决方案
- Jetpack Compose 教程
- SSRS筛选器的IN运算(即包含于)用法
- 升级智能开关,“零火版”、“单火”接线方式差异有多大?
- Online sql to excel (xls/xlsx) tool
- Technologie de base de la programmation Shell IV
- Is it safe to open an account at Great Wall Securities? How to open an account when buying stocks
猜你喜欢
【问题】druid报异常sql injection violation, part alway true condition not allow 解决方案
用实际例子详细探究OpenCV的轮廓绘制函数drawContours()
Pytorch学习(四)
Opencv functions and methods related to binary threshold processing are summarized for comparison and use
在线文本行固定长度填充工具
Comment utiliser async awati asynchrone Task Handling au lieu de backgroundworker?
FPGA时序约束分享01_四大步骤简述
Oracle with as ORA-00903: invalid table name 多表报错
Go microservice (II) - detailed introduction to protobuf
Safer, smarter and more refined, Chang'an Lumin Wanmei Hongguang Mini EV?
随机推荐
TCP两次挥手,你见过吗?那四次握手呢?
Shell 编程核心技术《三》
Online text line fixed length fill tool
爬虫(6) - 网页数据解析(2) | BeautifulSoup4在爬虫中的使用
Lm10 cosine wave homeopathic grid strategy
Online sql to excel (xls/xlsx) tool
《工作、消费主义和新穷人》的微信读书笔记
prometheus安装
一文掌握数仓中auto analyze的使用
牛客小白月赛7 I 新建 Microsoft Office Word 文档
OpenCV的二值化处理函数threshold()详解
关于判断点是否位于轮廓内的一点思考
与二值化阈值处理相关的OpenCV函数、方法汇总,便于对比和拿来使用
There are multiple divs in the large div, which are displayed on the same line. After overflow, scroll bars are generated without line breaks
2014合肥市第三十一届青少年信息学奥林匹克竞赛(小学组)试题
Double colon function operator and namespace explanation
QT realizes interface sliding switching effect
How test engineers "attack the city" (Part I)
The page element is vertically and horizontally centered, realizing the vertical and horizontal centering of known or unknown width.
1009 Product of Polynomials(25 分)(PAT甲级)