• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
Hug_Sea
博客园    首页    新随笔    联系   管理    订阅  订阅
2012年8月3日
POJ-3126 Prime Path
摘要: 题意:给出两个四位素数a、b,问从a到b最少变几次(每次变1位并且只能为素数)。思路:bfs。题目链接:http://poj.org/problem?id=3126View Code 1 #include <cstdio> 2 #include <cmath> 3 #include <cstdlib> 4 #include <cstring> 5 #include <string> 6 #include <queue> 7 #include <algorithm> 8 #include <iostream 阅读全文
posted @ 2012-08-03 19:42 Hug_Sea 阅读(165) 评论(0) 推荐(0)
POJ-2689 Prime Distance
摘要: 题意:给定两个数L、U,求L到U范围内相邻两个素数之差最小和最大的两对素数。思路:因为1<=L< U<=2,147,483,647,而U-L<=1,000,000,所以要对L到U范围内进行素数筛选,然后找出即可。题目链接:http://poj.org/problem?id=2689View Code 1 #include <cstdio> 2 #include <cmath> 3 #include <cstdlib> 4 #include <cstring> 5 #include <string> 6 #inc 阅读全文
posted @ 2012-08-03 10:48 Hug_Sea 阅读(139) 评论(0) 推荐(0)
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3