摘要: 题目连接:http://poj.org/problem?id=2065 高斯消元求出上三角矩阵后,求出 a×x = b(mod p),即 a×x - p×y=b,用扩展欧几里得求出x。 1 //STATUS:C++_AC_32MS_156KB 2 #include <functional> 3 #include <algorithm> 4 #include <iostream> 5 //#include <ext/rope> 6 #include <fstream> 7 #include <sstr 阅读全文
posted @ 2013-05-31 00:58 zhsl 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 题目连接:http://poj.org/problem?id=2947 求解形如: a11×x11%p+a12×x12%p+......+a1n×x1n%p=k1%p a21×x21%p+a22×x22%p+......+a2n×x2n%p=k2%p ...... an1×xn1%p+an2×xn2%p+......+ann×xnn%p=kn%p 直接取模求解线性方程组。在网上找了一个整数Gauss的模板,貌似网上很多都是用的这个,但这个模板在多解情况下求变元是否确定有问题,应该用高斯-约当消元求出最简的 阅读全文
posted @ 2013-05-31 00:52 zhsl 阅读(258) 评论(0) 推荐(0) 编辑
摘要: 题目连接:http://poj.org/problem?id=3185 异或高斯消元简单题。 1 //STATUS:C++_AC_16MS_488KB 2 #include <functional> 3 #include <algorithm> 4 #include <iostream> 5 //#include <ext/rope> 6 #include <fstream> 7 #include <sstream> 8 #include <iomanip> 9 #include <numeric> 阅读全文
posted @ 2013-05-31 00:40 zhsl 阅读(177) 评论(0) 推荐(0) 编辑