- 博客(4)
- 收藏
- 关注
原创 hdu1005(矩阵加速)
构造二阶矩阵即可 #include const int N = 2; const int MOD = 7; struct mat { int a[N][N]; }; mat mul(mat x, mat y) { mat t; for(int i = 0; i < N; i++) { for(int j = 0; j < N; j++)
2015-08-06 20:32:45 286
原创 hdu1757(矩阵加速)
#include #include const int N = 10; int MOD; int n; struct mat { int a[N + 10][N + 10]; }; mat mul(mat x, mat y) { mat t; for(int i = 0; i < N; i++) { for(int j = 0; j < N;
2015-08-06 20:22:10 306
原创 poj 1151 hdu 1542 atlantis (线段树+扫描线)
盗用一张样例的图,不过x,y轴反了,大家最好照着图先在纸上演一遍。再看代码,代码我注释很详细,希望大家都能看懂。 第二次写这题了,又发现上一次没完全弄懂的东西,所以重新来一遍,写清楚了所有注释。 #include #include #include #include #include using namespace std; #define N 100010 #defi
2015-07-30 09:07:47 293
原创 差分约束 [1](poj 3159)(简单)
差分约束:其实就是解一组三角形不等式 A+c 这道题比较裸,正常建完图后求一次最短路就ok;就是在用spfa时不能用队列,会超时,拿一个数组模拟就行; #include #include #include #include using namespace std; #define oo 1 #define M 155555 #define N 33333 int n,
2015-07-28 09:30:45 282
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人