ZOJ
文章平均质量分 76
xiamiwage
这个作者很懒,什么都没留下…
展开
-
ZOJ 3464 Rugby Football 水题
//ZOJ 3464 Rugby Football //水题 #include #include #define N 10005 int a[N]; int n,t,l; int cmp(const void *a,const void *b){ return *(int *)b - *(int *)a; } int main(){ int T; int i;原创 2012-09-27 00:34:11 · 780 阅读 · 0 评论 -
ZOJ 3396 Conference Call 求经过特定3点的最小生成树
//ZOJ 3396 Conference Call //题意 求经过特定3点的最小生成树 //思路:枚举任何一点作为支撑点 ,特定的3点要相连必须经过共同的一点 ,求这三点到所枚举点的最短路和,取最小值即为答案 #include #include #include #include using namespace std; #define INF 50000000 #define N 2000原创 2012-09-27 00:32:37 · 781 阅读 · 0 评论 -
ZOJ 3465 The Hive 暴力模拟
//ZOJ 3465 The Hive //暴力模拟 #include #include #include using namespace std; #define N 10 int n; char s[N]; stackS[N]; int arr[N] = {0,7,8,9,10,11,10,9,8,7}; void init(){ int i; for(i = 1; i <原创 2012-09-27 00:34:45 · 719 阅读 · 0 评论 -
POJ 2299 && ZOJ 2386 Ultra-QuickSort 线段树
//POJ 2299 && ZOJ 2386 Ultra-QuickSort 线段树 /* 题意: 给一个序列,序列中的数都不重复,每次可以将序列中的两个数交换, 求将这个序列变成升序序列的最小交换次数 思路: 其实就是求这个序列的逆序数,离散化后边查询边插入即可 注意ans会爆int */ #include #include #include #define lson rt<<1,l,mi原创 2012-10-02 23:46:28 · 1166 阅读 · 0 评论 -
ZOJ 1610 Count the Colors 线段树 成段更新 单点求值
//ZOJ 1610 Count the Colors 线段树 成段更新 单点求值 /* 题意: 有一个0-8000的区间,每次将一个子区间染色,颜色用整数表示, 如果一段区间被重复染色的话,它的颜色会被后面染上去的颜色覆盖 问最后有几种颜色出现,每种颜色的区间有多少个 思路: 注意是对区间染色,不是对点染色。 成段更新 单点求值 由于不需要知道父节点的信息,所以不需要pushup。 */ #原创 2012-10-03 00:26:25 · 1271 阅读 · 0 评论