• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
Hug_Sea
博客园    首页    新随笔    联系   管理    订阅  订阅
2012年8月7日
POJ-3090 Visible Lattice Points
摘要: 题意:给定N,求0<=x<=N,0<=y<=N范围内,从点(0,0)到点(x,y)画一条线段,不经过任何点的点的总和.思路:就是求小于等于N的所有欧拉函数之和乘2加1.题目链接:http://poj.org/problem?id=3090View Code 1 #include <cstdio> 2 #include <cmath> 3 #include <cstdlib> 4 #include <cstring> 5 #include <string> 6 #include <algorithm> 阅读全文
posted @ 2012-08-07 15:06 Hug_Sea 阅读(120) 评论(0) 推荐(0)
POJ-2478 Farey Sequence
摘要: 题意:给定N,求所有小于等于N的a/b,gcd(a,b)=1(a<b).思路:就是求小于等于N的欧拉函数。题目链接:http://poj.org/problem?id=2478View Code 1 #include <cstdio> 2 #include <cmath> 3 #include <cstdlib> 4 #include <cstring> 5 #include <string> 6 #include <algorithm> 7 #include <iostream> 8 using nam 阅读全文
posted @ 2012-08-07 14:31 Hug_Sea 阅读(159) 评论(0) 推荐(0)
POJ-1284 Primitive Roots
摘要: 题意:给定奇素数N,求N的原根。思路:定理:奇素数N的原根等于φ(N-1),即直接求N-1的欧拉函数。题目链接:http://poj.org/problem?id=1284View Code 1 #include <cstdio> 2 #include <cstdlib> 3 #include <cmath> 4 #include <cstring> 5 #include <string> 6 #include <algorithm> 7 #include <iostream> 8 using namespac 阅读全文
posted @ 2012-08-07 09:53 Hug_Sea 阅读(164) 评论(0) 推荐(0)
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3