当前位置:网站首页>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;
}
边栏推荐
- Stream stream
- English语法_名词 - 使用
- There are multiple divs in the large div, which are displayed on the same line. After overflow, scroll bars are generated without line breaks
- Educational Codeforces Round 22 E. Army Creation
- socket编程demo二
- In flinksql, in addition to data statistics, is the saved data itself a state
- Is it safe to open an account at Great Wall Securities? How to open an account when buying stocks
- Unity editor extends C to traverse all pictures in folders and subdirectories
- 反射(一)
- 矩阵翻转(数组模拟)
猜你喜欢

Comment utiliser async awati asynchrone Task Handling au lieu de backgroundworker?

Use canal and rocketmq to listen to MySQL binlog logs

2022CoCa: Contrastive Captioners are Image-Text Fountion Models

OpenCV的二值化处理函数threshold()详解

用实际例子详细探究OpenCV的轮廓绘制函数drawContours()
牛客小白月赛7 谁是神箭手

The 300th weekly match of leetcode (20220703)

The explain statement in MySQL queries whether SQL is indexed, and several types in extra collate and summarize

如何使用Async-Awati异步任务处理代替BackgroundWorker?

PolyFit软件介绍
随机推荐
FPGA时序约束分享01_四大步骤简述
To sort out messy header files, I use include what you use
【问题】druid报异常sql injection violation, part alway true condition not allow 解决方案
在线SQL转Excel(xls/xlsx)工具
Shell programming core technology II
Stream stream
Use canal and rocketmq to listen to MySQL binlog logs
Nebula importer data import practice
数组中的第K个最大元素
92.(cesium篇)cesium楼栋分层
OpenCV的二值化处理函数threshold()详解
2022CoCa: Contrastive Captioners are Image-Text Fountion Models
HDU 1372 & POJ 2243 Knight Moves(广度优先搜索)
偏移量函数及开窗函数
Pytest 可视化测试报告之 Allure
1008 Elevator(20 分)(PAT甲级)
Master the use of auto analyze in data warehouse
Oracle with as ORA-00903: invalid table name 多表报错
SSRS筛选器的IN运算(即包含于)用法
用实际例子详细探究OpenCV的轮廓绘制函数drawContours()