CodeForces - 1047B Cover Points】的更多相关文章

B. Cover Points time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output There are n points on the plane, (x1,y1),(x2,y2),-,(xn,yn). You need to place an isosceles triangle with two sides on the coordin…
题目: There are nn points on the plane, (x1,y1),(x2,y2),…,(xn,yn)(x1,y1),(x2,y2),…,(xn,yn). You need to place an isosceles triangle with two sides on the coordinate axis to cover all points (a point is covered if it lies inside the triangle or on the s…
D. Points Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/19/problem/D Description Pete and Bob invented a new interesting game. Bob takes a sheet of paper and locates a Cartesian coordinate system on it as follows: point (…
link:http://codeforces.com/contest/347/problem/B 很简单,最多只能交换一次,也就是说,最多会增加两个.可能会增加一个.也可能一个也不增加(此时都是fixed point) #include <cstdio> using namespace std; ]; int main(void) { #ifndef ONLINE_JUDGE freopen("in.txt", "r", stdin); #endif i…
题目链接: E. Points on Plane time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output On a plane are n points (xi, yi) with integer coordinates between 0 and 106. The distance between the two points wi…
题目链接:http://codeforces.com/problemset/problem/347/B 题目意思:给出一个包含n个数的排列a,在排列a中最多只能作一次交换,使得ai = i 这样的匹配达到最多. 作一次交换,最理想的情况是,在原来匹配好的序列中再匹配到两个数:最坏的情况是,即使作怎样的交换,都不可能再找到可以匹配的两个数,也就是说,根本不需要作交换.至于一般情况下,是可以再匹配到一个数的. 我是设了两个数组(分别有n个数):a(用来存储待判断的序列a)和b(依次存储0-n-1个数…
题目链接:http://codeforces.com/contest/19/problem/D 题意:给出3种操作:1)添加点(x,y),2)删除点(x,y),3)查询离(x,y)最近的右上方的点. 且满足添加的点不重复,删除的点一定存在. 题解:只要以x建树,记录下每个结点最大的y值.每次都更新一下.用线段树查找满足条件的最小的x,然后用一个set[x]来存x点下的y点. 然后用二分查找满足条件的最小的y. #include <iostream> #include <cstring&g…
题目描述: Match Points time limit per test 2 seconds memory limit per test 256 mega bytes input standard input output standard output You are given a set of points x1, , ..., *x**n* Two points iand jcan be matched with each other if the following conditi…
题 OvO http://codeforces.com/contest/871/problem/C ( Codeforces Round #440 (Div. 1, based on Technocup 2018 Elimination Round 2) - C ) 解 问题可以转化为:这些点可以产生的横线与竖线的出现情况 首先,对于二维坐标系中的每一行中,对于每个点,如果右边有点,则从该点向右边这个点(相邻的那个点)连一条边(连一条单向的), 对于每一列中,对于每个点,如果该点下面有点,则向下…
https://codeforces.com/problemset/problem/1000/C 题意: 有n个线段,覆盖[li,ri],最后依次输出覆盖层数为1~n的点的个数. 思路: 区间线段覆盖问题,第一反应树状数组.线段树,看了看数据规模,开不了这么大的空间. 只能用差分了  代码如下: #include <stdio.h> #include <string.h> #include <iostream> #include <string> #incl…