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…
题目链接: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段区间,他们有重合的点A,问你重合最多次的点A重合多少次 题解:对区间离散化后,维护区间最大值 #include<stdio.h> #include<string.h> #include<algorithm> #define LL long long #define MAX 100100 using namespace std; int s[MAX],e[…
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…
bc上的题目,很水,有很多方法做吧,题意大概就是给定你票数,然后让你求出票数最多的那个下标...... 之前我用两个for循环分开写,一个是读入,然后是判断,提交就wa,后来网上看了别人的,就是不能分开写,边读入边处理,开了下,感觉不是很明白....(/ □ \) AC代码: #include <iostream> #include <cstring> using namespace std; int a[1100]; int main(), { int t,n,i,k; cin&…
n个矩形 问他们覆盖的面积重复的就算一次 x数组存线段 然后根据横坐标排一下 z 线段树 l - r 就是1 ~ 2*n #include<stdio.h> #include<algorithm> #include<string.h> using namespace std; #define MAXN 110 struct line { double x,y1,y2; int flag; }x[MAXN]; ]; struct node { int l,r,cov…
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…