• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
Hug_Sea
博客园    首页    新随笔    联系   管理    订阅  订阅
2012年8月2日
POJ-2909 Goldbach's Conjecture
摘要: 题意:给定一个偶数n,求将其分解成两个素数的种数。思路:水水。。。题目链接:http://poj.org/problem?id=2909View Code 1 #include <cstdio> 2 #include <cmath> 3 #include <cstdlib> 4 #include <cstring> 5 #include <string> 6 #include <algorithm> 7 #include <iostream> 8 using namespace std; 9 const int 阅读全文
posted @ 2012-08-02 19:10 Hug_Sea 阅读(99) 评论(0) 推荐(0)
POJ-2262 Goldbach's Conjecture
摘要: 题意:给定一个偶数n,将其分解成两个素数(有多组则输出差值最大的)。思路:水水.......题目链接:http://poj.org/problem?id=2262View Code 1 #include <cstdio> 2 #include <cmath> 3 #include <cstdlib> 4 #include <cstring> 5 #include <string> 6 #include <algorithm> 7 #include <iostream> 8 using namespace std 阅读全文
posted @ 2012-08-02 18:56 Hug_Sea 阅读(102) 评论(0) 推荐(0)
POJ-2191 Mersenne Composite Numbers
摘要: 题意:给定k,求所有满足小于2^k的所有梅森数(2^p(p为素数)-1被素因子分解的数)。思路:此题一看就想到打表、先暴力打表,然后直接写即可。题目链接:http://poj.org/problem?id=2191View Code 1 /**********************************暴力打表***************************** 2 #include <cstdio> 3 #include <cmath> 4 #include <cstdlib> 5 #include <cstring> 6 #incl 阅读全文
posted @ 2012-08-02 16:09 Hug_Sea 阅读(334) 评论(0) 推荐(0)
POJ-3641 Pseudoprime numbers
摘要: 题意:对于一个非素数p和任意一个数a,若a^p=a(mod p),则输出yes,否则输出no。思路:判断素数+二分幂。题目链接:http://poj.org/problem?id=3641View Code 1 #include <cstdio> 2 #include <cmath> 3 #include <cstdlib> 4 #include <cstring> 5 #include <string> 6 #include <algorithm> 7 #include <iostream> 8 using 阅读全文
posted @ 2012-08-02 11:24 Hug_Sea 阅读(125) 评论(0) 推荐(0)
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3