题目链接: 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…
题目描述 On a plane are nn points ( x_{i}xi , y_{i}yi ) with integer coordinates between 00 and 10^{6}106 . The distance between the two points with numbers aa and bb is said to be the following value: (the distance calculated by such formula is calle…
C. Points on Plane Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/576/problem/C Description On a plane are n points (xi, yi) with integer coordinates between 0 and 106. The distance between the two points with numbers a and…
C. Points on Plane On a plane are n points (xi, yi) with integer coordinates between 0 and 106. The distance between the two points with numbers a and bis said to be the follow…
题目大意:在一个平面里有n个点,点坐标的值在1-1e6之间,让你给出一个遍历所有点的顺序,要求每个点走一次,且 曼哈顿距离之和小于25*1e8. 思路:想了一会就有了思路,我们可以把1e6的x,y坐标都分成2000份,每份500,然后这样整个平面就被分成 了2000*2000个区域,然后按区域输出点就行了. #include<bits/stdc++.h> using namespace std; int n; vector<][]; int main() { scanf("%d…
B. Plane of Tanks: Pro Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/175/problem/B Description Vasya has been playing Plane of Tanks with his friends the whole year. Now it is time to divide the participants into several…
http://codeforces.com/contest/872/problem/E E. Points, Lines and Ready-made Titles time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given n distinct points on a plane with integral…
B. z-sort 题目连接: http://www.codeforces.com/contest/652/problem/B Description A student of z-school found a kind of sorting called z-sort. The array a with n elements are z-sorted if two conditions hold: ai ≥ ai - 1 for all even i, ai ≤ ai - 1 for all…
Codeforces Round #384 (Div. 2) 题目链接:Vladik and fractions Vladik and Chloe decided to determine who of them is better at math. Vladik claimed that for any positive integer \(n\) he can represent fraction \(\frac{2}{n}\) as a sum of three distinct posi…
Description Little Petya likes points a lot. Recently his mom has presented him n points lying on the line OX. Now Petya is wondering in how many ways he can choose three distinct points so that the distance between the two farthest of them doesn't e…
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 (0, 0) is located in the bottom-left corner, Ox axis is directed right, Oy axis is directed up. Pete gives Bob…
D. Points time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Pete and Bob invented a new interesting game. Bob takes a sheet of paper and locates a Cartesian coordinate system on it as follow…
Regular Bridge time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output An undirected graph is called k-regular, if the degrees of all its vertices are equal k. An edge of a connected graph is cal…