CodeforcesRound#112(Div.2)-A.SupercentralPoint_html/css_WEB-ITnose
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了CodeforcesRound#112(Div.2)-A.SupercentralPoint_html/css_WEB-ITnose,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含4004字,纯文字阅读大概需要6分钟。
内容图文
![CodeforcesRound#112(Div.2)-A.SupercentralPoint_html/css_WEB-ITnose](/upload/InfoBanner/zyjiaocheng/400/9269f39f512445e0a32273fe896e0d9b.jpg)
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
One day Vasya painted a Cartesian coordinate system on a piece of paper and marked some set of points (x1,?y1),?(x2,?y2),?...,?(xn,?yn). Let's define neighbors for some fixed point from the given set (x,?y):
We'll consider point (x,?y) from the given set supercentral, if it has at least one upper, at least one lower, at least one left and at least one right neighbor among this set's points.
Vasya marked quite many points on the paper. Analyzing the picture manually is rather a challenge, so Vasya asked you to help him. Your task is to find the number of supercentral points in the given set.
Input
The first input line contains the only integer n (1?≤?n?≤?200) ? the number of points in the given set. Next n lines contain the coordinates of the points written as "x y" (without the quotes) (|x|,?|y|?≤?1000), all coordinates are integers. The numbers in the line are separated by exactly one space. It is guaranteed that all points are different.
Output
Print the only number ? the number of supercentral points of the given set.
Sample test(s)
input
81 14 23 11 20 20 11 01 3
output
input
50 00 11 00 -1-1 0
output
Note
In the first sample the supercentral points are only points (1,?1) and (1,?2).
In the second sample there is one supercental point ? point (0,?0).
解题思路:没什么说的,直接暴力搞了。遍历每个点,看是否符合要求。为了省时间,我们可以在输入的时候把x的上限,下限,和y的上限和下限先记录一下,在判断每个点的时候会用到。
AC代码:
#include#include #include #include #include #include #include #include
内容总结
以上是互联网集市为您收集整理的CodeforcesRound#112(Div.2)-A.SupercentralPoint_html/css_WEB-ITnose全部内容,希望文章能够帮你解决CodeforcesRound#112(Div.2)-A.SupercentralPoint_html/css_WEB-ITnose所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。