hdu 5124】的更多相关文章

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5124 题目意思:给出 n 条线段,每条线段用两个整数描述,对于第 i 条线段:xi,yi 表示该条线段的左端点和右端点.设 A 表示最多线段覆盖的点(当然这个 A 可以有多个啦,但这个无关紧要).现在需要求的是 A 被多少条线段覆盖. 我是不会做啦.......一开始还看不懂题目= = 以下是按照题解做的, 题解中的最大区间和,实际上就是求最大连续子序列的和. (1)版本1   906 MS #in…
http://acm.hdu.edu.cn/showproblem.php?pid=5124 题意:给你n条线段,然后找出一个被最多条线段覆盖的点,输出覆盖这个点的线段的条数. 思路:可以把一条线段分出两个端点离散化,左端点被标记为-1,右端点被标记为1,然后排序,如果遇到标记为-1,cnt++,否则cnt--;找出cnt的最大值. #include <cstdio> #include <cstring> #include <algorithm> #define max…
http://acm.hdu.edu.cn/showproblem.php?pid=5124 [题意] 在数轴x上,每次操作都覆盖一个区间的所有点,问被覆盖次数最多的点是覆盖了多少次 [思路] 最简单的扫描线,左右端点分别排序,遇到左端点sum++更新最值,遇到右端点sun--更新最值 [Accepted] #include<bits/stdc++.h> using namespace std; ],b[]; int t,n; bool cmp(int aa,int bb) { return…
bc上的题目,很水,有很多方法做吧,题意大概就是给定你票数,然后让你求出票数最多的那个下标...... 之前我用两个for循环分开写,一个是读入,然后是判断,提交就wa,后来网上看了别人的,就是不能分开写,边读入边处理,开了下,感觉不是很明白....(/ □ \) AC代码: #include <iostream> #include <cstring> using namespace std; int a[1100]; int main(), { int t,n,i,k; cin&…
lines Time Limit: 5000/2500 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1575    Accepted Submission(s): 656 Problem Description John has several lines. The lines are covered on the X axis. Let A is a point which…
http://acm.hdu.edu.cn/showproblem.php?pid=4325 Flowers Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2633    Accepted Submission(s): 1290 Problem Description As is known to all, the blooming t…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5124 题意:给你n段区间,他们有重合的点A,问你重合最多次的点A重合多少次 题解:对区间离散化后,维护区间最大值 #include<stdio.h> #include<string.h> #include<algorithm> #define LL long long #define MAX 100100 using namespace std; int s[MAX],e[…
http://acm.hdu.edu.cn/showproblem.php?pid=5124 lines Time Limit: 5000/2500 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1362    Accepted Submission(s): 566 Problem Description John has several lines. The lines are…
http://acm.hdu.edu.cn/showproblem.php?pid=5124 lines   Problem Description: John has several lines. The lines are covered on the X axis. Let A is a point which is covered by the most lines. John wants to know how many lines cover A.   Input: The firs…
Saving HDU Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 7194    Accepted Submission(s): 3345 Problem Description 话说上回讲到海东集团面临内外交困,公司的元老也只剩下XHD夫妇二人了.显然,作为多年拼搏的商人,XHD不会坐以待毙的.  一天,当他正在苦思冥想解困良策的…