## ramay7

https://ramay7.github.io/

# POJ 3090 Visible Lattice Points（欧拉函数）

POJ 3090 Visible Lattice Points

#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <algorithm>
#include <climits>
#include <cmath>
#include <ctime>
#include <cassert>
#define IOS ios_base::sync_with_stdio(0); cin.tie(0);
using namespace std;
typedef long long ll;
const int MAX_N = 1010;

int T, n, cases = 0;
ll euler[MAX_N];

void GetEuler()
{
euler[1] = 1;
for(int i = 2; i < MAX_N; i++){
if(euler[i] == 0){
for(int j = i; j < MAX_N; j += i){
if(euler[j] == 0) euler[j] = j;
euler[j] = euler[j] / i * (i - 1);
}
}
}
}

int main()
{
GetEuler();
scanf("%d", &T);
while(T--){
scanf("%d", &n);
ll sum = 0;
for(int i = 1; i <= n; i++){
sum += euler[i];
}
sum = sum * 2 + 1;
printf("%d %d %lld\n", ++cases, n, sum);
}
return 0;
}


#### Visible Lattice Points（Poj3090）（欧拉函数运用）

2015-12-18 12:36:20

#### poj 3090 Visible Lattice Points (欧拉函数)

2017-12-25 20:26:33

#### Poj 3090 Visible Lattice Points（欧拉函数）

2015-04-10 01:01:06

#### POJ 3090 Visible Lattice Points 欧拉函数的应用

2014-02-19 14:16:06

#### POJ 3090 Visible Lattice Points 欧拉函数

2011-02-07 20:02:00

#### POJ 3090 Visible Lattice Points (欧拉函数)

2015-02-10 13:04:16

#### POJ 3090 Visible Lattice Points （欧拉函数）

2016-08-16 02:02:31

#### POJ 3090 Visible Lattice Points 欧拉函数运用

2016-08-19 18:42:34

#### Visible Lattice Points POJ - 3090 （欧拉函数筛）

2017-09-07 22:10:03

#### 【POJ】3090 Visible Lattice Points 欧拉函数

2017-08-24 20:39:31