上一页 1 ··· 44 45 46 47 48 49 50 51 52 ··· 56 下一页
摘要: 这题不能直接按常规做啊,因为数组根本就开不下,转换思维A(B*A)^(n*n-1)B 这样的话数组B*A就是10*10了,然后快速幂就行了 刚开始数组都开小了,tle,还找了半天bug。。。还有就是定义三个struct真累。。。 #include<map> #include<set> #includ 阅读全文
posted @ 2017-05-16 20:35 walfy 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 就是优化一段代码,用矩阵快速幂(刚开始想到了转移矩阵以为是错的) 在搜题解时发现了一个神奇的网站:http://oeis.org/ 用来找数列规律 的神器。。。。 规律就是an=an-1+2*an-2+1 然后构造矩阵就行了 还有特例1的时候记得%m #include<map> #include<s 阅读全文
posted @ 2017-05-16 19:25 walfy 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 参考博客:http://blog.csdn.net/rowanhaoa/article/details/39343769 反正递推关系式推了一个多小时没搞出来。。。太弱了 真是愧对数学系这一专业了。。。。 转移矩阵就是这个: 10 0 0 0 0 1 10 1 0 0 0 1 10 1 1 0 0 阅读全文
posted @ 2017-05-15 21:25 walfy 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 找出递推关系式就好了 (fi+1)=(1 -1)(fi ) ( fi)=(1 0)(fi-1) 不会打矩阵将就着看吧。。。 这是第一道矩阵快速幂。细节还是有很多没注意到的 本来想看挑战写的,结果上面的vector套vector看的我头都晕了。。 #include<map> #include<set> 阅读全文
posted @ 2017-05-15 19:54 walfy 阅读(182) 评论(0) 推荐(0) 编辑
摘要: During several decades, scientists from planet Nibiru are working to create an engine that would allow spacecrafts to fall into hyperspace and move th 阅读全文
posted @ 2017-05-15 16:48 walfy 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 题意:给一个图,1是可以放,0是不能放,可以放的地方放的不能相邻,求所有情况 题解:状压dp 参考博客:http://www.tuicool.com/articles/JVzMVj #include<map> #include<set> #include<cmath> #include<queue> 阅读全文
posted @ 2017-05-13 16:01 walfy 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 状压dp第一题:很多东西没看懂,慢慢来,状压dp主要运用了位运算,二进制处理 集合{0,1,2,3,....,n-1}的子集可以用下面的方法编码成整数 像这样,一些集合运算就可以用如下的方法来操作: 1.空集....................0 2.只含有第i个元素的集合{i}........ 阅读全文
posted @ 2017-05-12 14:19 walfy 阅读(186) 评论(0) 推荐(0) 编辑
摘要: It's time for music! A lot of popular musicians are invited to join us in the music festival. Each of them will play one of their representative songs 阅读全文
posted @ 2017-05-11 22:16 walfy 阅读(160) 评论(0) 推荐(0) 编辑
摘要: Chen, Adrian (November 7, 2013). “Doge Is An Ac- tually Good Internet Meme. Wow.”. Gawker. Retrieved November 22, 2013. Doge is an Internet meme that 阅读全文
posted @ 2017-05-10 15:13 walfy 阅读(201) 评论(0) 推荐(0) 编辑
摘要: One day, sailormoon girls are so delighted that they intend to research about palindromic strings. Operation contains two steps: First step: girls wil 阅读全文
posted @ 2017-05-10 14:47 walfy 阅读(238) 评论(0) 推荐(0) 编辑
上一页 1 ··· 44 45 46 47 48 49 50 51 52 ··· 56 下一页