• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
Hug_Sea
博客园    首页    新随笔    联系   管理    订阅  订阅
2012年6月18日
POJ-3518 Prime Gap
摘要: 题意:给定一个数k,求包含k在内的连续非素数序列的长度。思路:水..........题目链接:http://poj.org/problem?id=3518View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <cstdlib> 4 #include <cmath> 5 #include <string> 6 #include <algorithm> 7 #include <iostream> 8 using namespace std; 9 阅读全文
posted @ 2012-06-18 21:49 Hug_Sea 阅读(214) 评论(0) 推荐(0)
POJ-2379 Sum of Consecutive Prime Numbers
摘要: 题意:给定一个数n,找出连续n个素数相加等于这个数的种数。思路:水.......题目链接:http://poj.org/problem?id=2739View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <cstdlib> 4 #include <cmath> 5 #include <string> 6 #include <algorithm> 7 #include <iostream> 8 using namespace std; 9 co 阅读全文
posted @ 2012-06-18 21:03 Hug_Sea 阅读(145) 评论(0) 推荐(0)
HDU-2181 哈密顿绕行世界问题
摘要: 题意:一个规则的实心十二面体,它的 20个顶点标出世界著名的20个城市,你从一个城市出发经过每个城市刚好一次后回到出发的城市,给出每一个点相邻的点,求每一个序列。思路:dfs.题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2181View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <cstdlib> 4 #include <cmath> 5 #include <string> 6 #include <algor 阅读全文
posted @ 2012-06-18 20:43 Hug_Sea 阅读(171) 评论(0) 推荐(0)
HDU-1572 下沙小面的(2)
摘要: 题意:给出n*n的矩阵、代表两点之间的距离,给出k个乘客和乘客要下的站点,起点在0,求从起点到每个站点的最短距离。思路:dfs找出最短距离即可.题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1572View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <cstdlib> 4 #include <cmath> 5 #include <string> 6 #include <algorithm> 7 #incl 阅读全文
posted @ 2012-06-18 20:20 Hug_Sea 阅读(127) 评论(0) 推荐(0)
POJ-2034 Anti-prime Sequences
摘要: 题意:给出三个数n,m,d,求n到m间满足相邻2~d个数的和是非素数的序列。思路:dfs。题目链接:http://poj.org/problem?id=2034View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <cstdlib> 4 #include <cmath> 5 #include <string> 6 #include <algorithm> 7 #include <iostream> 8 using namespace std; 阅读全文
posted @ 2012-06-18 19:35 Hug_Sea 阅读(171) 评论(0) 推荐(0)
POJ-1365 Prime Land
摘要: 题意:已知任意一个大于1的数可以表示成一些素数的乘积,即x=p1^e1*p2^e2……pn^en (pi 为素数,ei 为对应素数的个数),现给你x的表示,要你求x-1的表示。例:输入:5 1 2 1 则x=5^1*2^1=10,所以x-1=9,9可以表示成:9=3^2 输出:3 2思路:打出素数表、然后从小到大除即可。题目链接:http://poj.org/problem?id=1365View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <cstdlib> 4 #include < 阅读全文
posted @ 2012-06-18 09:02 Hug_Sea 阅读(124) 评论(0) 推荐(0)
HDU-1258 Sum It Up
摘要: 题意:给出sum和n个数,找出满足m(m<=n)个数相加等于sum。思路:dfs.题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1258View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <cstdlib> 4 #include <cmath> 5 #include <string> 6 #include <algorithm> 7 #include <iostream> 8 using 阅读全文
posted @ 2012-06-18 08:58 Hug_Sea 阅读(161) 评论(0) 推荐(0)
HDU-1181 变形课
摘要: 题意:给出n个单词,判断是否存在以‘b’开头,‘m’结尾的情况。思路:dfs.题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1181View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <cstdlib> 4 #include <cmath> 5 #include <string> 6 #include <algorithm> 7 #include <iostream> 8 using name 阅读全文
posted @ 2012-06-18 08:56 Hug_Sea 阅读(145) 评论(0) 推荐(0)
POJ数学题目(转载)
摘要: 1.burnside定理,polya计数法 这个大家可以看brudildi的《组合数学》,那本书的这一章写的很详细也很容易理解。最好能完全看懂了,理解了再去做题,不要只记个公式。 *简单题:(直接用套公式就可以了) pku2409 Let it Bead http://acm.pku.edu.cn/JudgeOnline/problem?id=2409 pku2154 Color http://acm.pku.edu.cn/JudgeOnline/problem?id=2409 pku1286 Necklace of Beads ... 阅读全文
posted @ 2012-06-18 08:53 Hug_Sea 阅读(250) 评论(0) 推荐(0)
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3