• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
LyonLys
愿意在角落唱沙哑的歌 再大声也都是给你 请用心听 不要说话 Contact me via E-mail: lyon.lys@gmail.com
博客园    首页    新随笔    联系   管理    订阅  订阅
2012年10月1日
poj 2440 DNA (mid)
摘要: http://poj.org/problem?id=2440 题意是给出两种串,要求计算长度为L的,而且不含那两种子串的串的个数。 这个的做法主要是要靠状态转移,而且明白转移的技巧做这题就如鱼得水,轻松过了!长度为3的01串也就8种状态,如果我们把它编号了,以后添加一位的时候,根据最后三位,我们就可以从之前的装态将已统计的个数转移到现在当前这一层来。例如,0可以由0或4转移过来。 然后就可以简单的构造出矩阵来了!代码如下:View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <cassert&g 阅读全文
posted @ 2012-10-01 16:11 LyonLys 阅读(285) 评论(0) 推荐(0)
hdu 2276 Kiki & Little Kiki 2
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2276 还是矩阵快速幂的题,将异或的操作转换成矩阵乘法。1y!代码如下:View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <cassert> 4 #include <algorithm> 5 6 using namespace std; 7 8 const int maxSize = 100; 9 const int initMod = 1E9 + 7; 10 int curSize = 阅读全文
posted @ 2012-10-01 09:43 LyonLys 阅读(208) 评论(0) 推荐(0)
hdu 1757 A Simple Math Problem
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1757 如题,简单的矩阵快速幂。1y!View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <cassert> 4 #include <algorithm> 5 6 using namespace std; 7 8 const int maxSize = 10; 9 const int initMod = 1E9 + 7;10 int curSize = maxSize;11 int curM 阅读全文
posted @ 2012-10-01 00:41 LyonLys 阅读(192) 评论(0) 推荐(0)
poj 1840 Eqs
摘要: http://poj.org/problem?id=1840 简单hash。。。。很想知道那些200ms以内的是怎么搞的。。。View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <algorithm> 4 5 using namespace std; 6 7 const int mod = 4000037; 8 const int HASH = 0x20decade; 9 const int inf = 0x7fffffff;10 11 int hash[mod];12 int used 阅读全文
posted @ 2012-10-01 00:12 LyonLys 阅读(184) 评论(0) 推荐(0)
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3