摘要: http://codeforces.com/contest/463这场是我人生第一场cf啊。。悲剧处处是啊。首先,看不懂题,完全理解不了啊。都是wa了好几次才过的所以a和b这两sb题我做了1个小时!然后c这题我用cin。。。。。。。悲剧因为我听说cf评测机很快!!rating掉了73,1300名啊,... 阅读全文
posted @ 2014-08-30 18:46 iwtwiioi 阅读(233) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2299在两个元素相同的数列里,其中一个数列要移动到另一个数列相同元素相同的位置,那么要移动的次数就是这个数列关于另一个数列的逆序对数(hash后)逆序对的求法我原来的博文有 http://www.cnblogs.com/iwtwiioi/p/35... 阅读全文
posted @ 2014-08-30 12:25 iwtwiioi 阅读(249) 评论(0) 推荐(0) 编辑
摘要: http://wikioi.com/problem/1250/我就不说这题有多水了。0 11 1矩阵快速幂#include #include #include #include #include #include using namespace std;#define rep(i, n) for(i... 阅读全文
posted @ 2014-08-30 11:34 iwtwiioi 阅读(336) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=3150这题裸的矩阵很容易看出,假设d=1,n=5那么矩阵是这样的1 1 0 0 11 1 1 0 00 1 1 1 00 0 1 1 11 0 0 1 1这是n^3的,可是n#include #include #include #include ... 阅读全文
posted @ 2014-08-30 11:15 iwtwiioi 阅读(667) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=3070根据本题算矩阵,用快速幂即可。裸题#include #include #include #include #include #include using namespace std;#define rep(i, n) for(int i=0... 阅读全文
posted @ 2014-08-30 09:17 iwtwiioi 阅读(284) 评论(0) 推荐(0) 编辑
摘要: http://wikioi.com/problem/1281/矩阵真是个神奇的东西。。只要搞出一个矩阵乘法,那么递推式可以完美的用上快速幂,然后使复杂度降到log真是神奇。在本题中,应该很快能得到下边的矩阵: ┏ a, 0 ┓[Xn, c] × ┃ ┃ = [Xn+1, c] ... 阅读全文
posted @ 2014-08-30 09:02 iwtwiioi 阅读(293) 评论(1) 推荐(0) 编辑