上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 40 下一页

2013年10月6日

叉姐的魔法训练(第十课)---- 幽默大师卫冕战

摘要: 挖坑------------------------一 构造矩阵SGU 409 BerlandFlag构造在一个边长为n*n(也就是说面积为n*n*n*n的)正方形。正方形中只包含' * '和' . '。满足:使得将这个正方形分隔成n*n个大小为n*n的正方形之后,每个小正方形里都刚好有k个 ' * '每行每列都刚好只有k个' * '。[solution]根据样例推理构造。#include #include using namespace std;const int maxn=1005;int n,m;bool a[maxn][m 阅读全文

posted @ 2013-10-06 14:16 电子幼体 阅读(161) 评论(0) 推荐(0) 编辑

叉姐的魔法训练(第⑨课)---- 幽默大师职业赛

摘要: 挖坑-------------------------------一 数位DPPOJ 3208 Apocalypse Someday#include #include #include using namespace std;typedef long long LL;int s[4][10];LL a[15][4];void init(){ memset(s,0,sizeof(s)); s[0][6]=1; s[1][6]=2; s[2][6]=3; for(int i=0;in){ len=i; bre... 阅读全文

posted @ 2013-10-06 14:16 电子幼体 阅读(191) 评论(0) 推荐(0) 编辑

叉姐的魔法训练(第八课)---- 幽默术

摘要: --------------一 MSTDPPOJ 3538 Domestic Networks有n个点m条边,和5型6型两种线,每米花费p5、p6,各有q5、q6米。每条边要么用5型连接要么用6型,或不连接。求将n个点连接的最小花费。与最小花费的方案。首先求出最小生成树。在对树上的边进行dp。f[ i ][ j ] 表示 前i条路用5型j米的最小花费。f[i][j]=f[i-1][j]+c*p6 (第i条路不使用5型)f[i][j]=f[i-1][j-c]+c*p5 (第i条路使用5型)#include #include #include #include #include #define r 阅读全文

posted @ 2013-10-06 13:32 电子幼体 阅读(200) 评论(0) 推荐(0) 编辑

2013年10月3日

叉姐的魔法训练(第七课)---- 在沙漠中的长途旅行

摘要: 挖坑..---------------------------一 生成子图POJ 2793 Cactus含有G的所有顶点的子图称为G的生成子图。问图是不是仙人掌树,若是仙人掌树,有多少生成子图。对于仙人掌树上的一个环,只删去一条边,仍是原图的生成子图。所以找到树上的每一个环,记录环上的点数,所有环上的点数相乘即是生成子图个数。数据较大要用高精度处理。#include #include #include #include #define fil(x) memset(x,0,sizeof(x))#define clr(x,a) memset(x,a,sizeof(x))using namespac 阅读全文

posted @ 2013-10-03 20:44 电子幼体 阅读(176) 评论(0) 推荐(0) 编辑

叉姐的魔法训练(第六课)---- 暴雨术入门

摘要: 挖坑...--------------------------------一 小学奥数HDU 4103 Clock火星有A小时B分钟,一天有多少次分针超过时针θ呢。当然是A-1次啦。#include #include #include using namespace std;const double eps=1e-9;int main(){ int A,B; double t; while ((~scanf("%d%d%lf",&A,&B,&t))&&(A!=0||B!=0||fabs(t)>eps)){ printf(&quo 阅读全文

posted @ 2013-10-03 20:42 电子幼体 阅读(207) 评论(0) 推荐(0) 编辑

叉姐的魔法训练(第五课)---- 如何成为一名合格的小学生

摘要: 挖坑------------------一 小学贪心HDU 3552 I can do it!题目大意:一个元素分为2个属性,a和b。然后将元素分成2个集合A和B。求出"A集合的a属性的最大值+B集合的b属性的最大值"的最小值 解题思路:一篇很详细的结题报告http://blog.csdn.net/dgq8211/article/details/7748078#include #include #include #include using namespace std;const int maxn=111111;const int INF=0x3f3f3f3f;struct 阅读全文

posted @ 2013-10-03 20:37 电子幼体 阅读(248) 评论(0) 推荐(0) 编辑

叉姐的魔法训练(第四课)---- 风系魔法的基本要领

摘要: 挖坑...----------------------一 十字计数POJ 3467 Cross Counting由于颜色的总数=N,每一个电脑和端口的座标已知,现在要求把N个电脑分别连到N个端口上,一个端口最多连一台电脑,一台电脑要连一个端口。电脑与端口连接的代价是他们的座标值之差,问最小代价是多少。这个问题初看是一个完美匹配问题,但是由于点数比较多,无法用最小费用最大流解决----------------------三 论文RMQhttp://wenku.baidu.com/view/53e2b6ed4afe04a1b071deb5.html题目大意:论文题,查询一段区间内数字不重复的最长子 阅读全文

posted @ 2013-10-03 20:36 电子幼体 阅读(441) 评论(0) 推荐(0) 编辑

叉姐的魔法训练(第三课)---- 火球术入门

摘要: -----------------------------------------一 双向贪心POJ 3040 Allowance从大到小贪心选取一次,从小到大选取一次。缺少证明。。。#include #include #include #include using namespace std;const int maxn=41;const int INF=0x3f3f3f3f;typedef long long LL;typedef pair PII;PII a[maxn];int use[maxn];int n,c;int main(){ while (~scanf("%d%d& 阅读全文

posted @ 2013-10-03 14:33 电子幼体 阅读(437) 评论(0) 推荐(0) 编辑

2013年10月1日

叉姐的魔法训练(第二课)---- 冰系魔法入门

摘要: -----------------------------一 矩阵相乘POJ 3213 PM 3给出三个矩阵A(NP)、B(PM)、C(NM) N,P,M#include #include #include #include using namespace std;typedef long long LL;const int maxn=1011;int N,P,M;int A[maxn][maxn],B[maxn][maxn];LL C[maxn][maxn];LL sumB[maxn],sumC[maxn];int wr,wl;LL rt;int main(){ while (~sca... 阅读全文

posted @ 2013-10-01 21:27 电子幼体 阅读(337) 评论(0) 推荐(0) 编辑

叉姐的魔法训练(第一课)---- 初级魔法练习

摘要: 一 集合操作POJ 2443 Set Operation有1000个集合每个集合有10000个元素,给出每个集合所有的元素和Q组询问,问元素x和y是否属于同一个集合。手抽写了个集合类出来,效率低了。其实用元素开数组,压缩所属的集合效率更高。#include #include #include #include using namespace std;const int maxn=1111;typedef unsigned int uint;const int Size=30;class SetOperation{private: uint st[400]; int getIdx(i... 阅读全文

posted @ 2013-10-01 16:37 电子幼体 阅读(204) 评论(0) 推荐(0) 编辑

上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 40 下一页

导航