摘要:POJ1830 开关问题 对于解异或方程组,系数可以采用二进制压缩,如果系数太多可以使用bitset,但是如果少一点就可以使用下述的写法,更加简单快速 使用bitset的写法更正常的没什么区别,只是对应的消除变为异或操作,另外行变换也会更加简单
阅读全文
摘要:装备购买HYSBZ - 4004 程序使用long double 这一类型,相比于double,long double 的精度更高,但运算速度稍微慢点 这是一道及其典型的高斯消元,应对的也是各种情况,有解的,没解的,已经未知数个数比方程数多或者少或者相等 可以当做模板
阅读全文
摘要:#define FOR(i,s,t) for(int i=(s);i>= 1; b1 = i&1; i >>= 1; b2 = i&1; } int sign(int b0, int b1, int b2) { return (b0 + b1 + b2) % 2 == 1 ? 1 : -1; } { FOR(x,1,a) FOR(y,1,b) FOR...
阅读全文
摘要:In mathematics, Cayley's formula is a result in graph theory named after Arthur Cayley. It states that for every positive integer n, the number of tre
阅读全文
摘要:#include #include #include #include using namespace std; int n; long long ans,pre; map,int> M; main() { scanf("%d",&n); cin>>pre; M[{1,pre}]++; for(int i=2,x;i<=n;i++){ scanf...
阅读全文
摘要:很好的一道题,欧拉筛与dp的结合 也可以理解为刷表法 具体解法没什么好说的,一看代码就明白了
阅读全文