POJ 3090 (欧拉函数) Visible Lattice Points
2014-12-18 05:28
309 查看
题意:
代码君
UVa 10820
这两个题是同一道题目,只是公式有点区别。#include <cstdio> const int maxn = 1000; int phi[maxn + 10]; void get_table() { for(int i = 2; i <= maxn; ++i) if(!phi[i]) { for(int j = i; j <= maxn; j += i) { if(!phi[j]) phi[j] = j; phi[j] = phi[j] / i * (i - 1); } } } int main() { freopen("3090in.txt", "r", stdin); get_table(); for(int i = 1; i <= maxn; ++i) phi[i] += phi[i - 1]; int T; scanf("%d", &T); for(int kase = 1; kase <= T; ++kase) { int n; scanf("%d", &n); printf("%d %d %d\n", kase, n, phi *2+3); } return 0; }
代码君
相关文章推荐
- POJ 3090-Visible Lattice Points(筛选法求欧拉函数)
- POJ 3090 Visible Lattice Points 欧拉函数
- POJ 3090 Visible Lattice Points | 其实是欧拉函数
- 数论 - 欧拉函数的运用 --- poj 3090 : Visible Lattice Points
- POJ 3090 Visible Lattice Points (欧拉函数)
- poj 3090 Visible Lattice Points (欧拉函数)
- POJ 3090 Visible Lattice Points(Farey数列&欧拉函数求和)
- POJ 3090 Visible Lattice Points(欧拉函数)
- poj 3090 Visible Lattice Points 欧拉函数打表求和
- POJ 3090 Visible Lattice Points 欧拉函数
- POJ 3090 Visible Lattice Points 【欧拉函数】
- poj 3090 Visible Lattice Points(数论:筛法打表欧拉函数)
- POJ 3090 Visible Lattice Points(欧拉函数)
- POJ 3090 Visible Lattice Points(欧拉函数)
- POJ 3090 Visible Lattice Points 欧拉函数运用
- [数论] POJ 3090/HOJ 2416 Visible Lattice Points 欧拉函数
- POJ 3090 Visible Lattice Points 欧拉函数的应用
- Poj 3090 Visible Lattice Points(欧拉函数)
- POJ 2478 Farey Sequence & POJ 3090 Visible Lattice Points (欧拉函数)
- POJ 3090 Visible Lattice Points 欧拉函数