1052 - See car

Time Limit:2s Memory Limit:64MByte

Submissions:594Solved:227

DESCRIPTION

You are the god of cars, standing at (a, b) point.There are some cars at point (xi,yi),

. If lots of cars and you are in one line, you can only see the car that is nearest to yourself. How many cars can you see?
It is guaranteed that xi>a && yi>b;

, which means the position of car.

OUTPUT
one line --- the number of car that you can see.

SAMPLE INPUT
2
0 0 3
1 1
2 2
3 3
0 0 4
1 1
2 2
2 3
4 6

SAMPLE OUTPUT
1
2
set的简单应用,去重
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <queue>
#include <cmath>
#include <ctime>
#include <map>
#include <set>
using namespace std;
#define lowbit(x) (x&(-x))
#define max(x,y) (x>y?x:y)
#define min(x,y) (x<y?x:y)
#define MAX 100000000000000000
#define MOD 1000000007
#define pi acos(-1.0)
#define ei exp(1)
#define PI 3.141592653589793238462
#define INF 0x3f3f3f3f3f
#define mem(a) (memset(a,0,sizeof(a)))
typedef long long ll;
int a,b,n,t,x,y;
set<double>s;
int main()
{
scanf("%d",&t);
while(t--)
{
scanf("%d%d%d",&a,&b,&n);
for(int i=;i<=n;i++)
{
scanf("%d%d",&x,&y);
double k=((y-b)*1.0)/((x-a)*1.0);
s.insert(k);
}
printf("%d\n",s.size());
s.clear();
}
return ;
}

玲珑学院 1052 - See car的更多相关文章

  1. 玲珑学院-ACM比赛1014 - Absolute Defeat

    1014 - Absolute Defeat Time Limit:2s Memory Limit:64MByte Submissions:257Solved:73 DESCRIPTION Eric ...

  2. 玲珑学院oj 1152 概率dp

    1152 - Expected value of the expression Time Limit:2s Memory Limit:128MByte Submissions:128Solved:63 ...

  3. 玲珑学院1072 【DFS】

    蛤蛤,略蠢. priority_queue 自定义优先级 和排序是反的 struct node { int x,y; friend bool operator< (node a,node b) ...

  4. 玲珑学院OJ 1023 - Magic boy Bi Luo with his excited math problem 树状数组暴力

    分析:a^b+2(a&b)=a+b  so->a^(-b)+2(a&(-b))=a-b 然后树状数组分类讨论即可 链接:http://www.ifrog.cc/acm/probl ...

  5. 玲珑学院OJ 1028 - Bob and Alice are playing numbers 字典树,dp

    http://www.ifrog.cc/acm/problem/1028 题解处:http://www.ifrog.cc/acm/solution/4 #include <cstdio> ...

  6. 玲珑学院 1010 - Alarm

    1010 - Alarm Time Limit:1s Memory Limit:128MByte DESCRIPTION Given a number sequence [3,7,22,45,116, ...

  7. 玲珑学院 1050 - array

    1050 - array Time Limit:3s Memory Limit:64MByte Submissions:494Solved:155 DESCRIPTION 2 array is an ...

  8. 玲珑学院 1014 Absolute Defeat

    SAMPLE INPUT 3 2 2 2 1 1 5 1 4 1 2 3 4 5 4 10 3 1 2 3 4 SAMPLE OUTPUT 1 0 15 前缀和,每个元素都判断一下. #include ...

  9. 强强联合,Testin云测&云层天咨众测学院开课了!

    Testin&云层天咨众测学院开课了! 共享经济时代,测试如何赶上大潮,利用碎片时间给女票或者自己赚点化妆品钱?   2016年12月13日,Testin联手云层天咨带领大家一起推开众测的大门 ...

随机推荐

  1. vue1.0父子、兄弟间 通信案例

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  2. 运维派 企业面试题2 创建10个 "十个随机字母_test.html" 文件

    Linux运维必会的实战编程笔试题(19题) 企业面试题2: 使用for循环在/tmp/www目录下通过随机小写10个字母加固定字符串test批量创建10个html文件,名称例如为: --[root@ ...

  3. [APIO2014]回文串 后缀自动机_Manancher_倍增

    Code: // luogu-judger-enable-o2 #include <cstdio> #include <algorithm> #include <cstr ...

  4. unity 美术注意事项

    有时候美术的一个不小心,就会给程序徒增极大的工作量,所以在项目开始之前是有必要和美术沟通一下,来规范一些东西, 1.将单体模型的轴心置中. 2.模型有父物体时,子物体应相对于父物体的(0,0,0)位置 ...

  5. 【Codeforces Round #422 (Div. 2) B】Crossword solving

    [题目链接]:http://codeforces.com/contest/822/problem/B [题意] 让你用s去匹配t,问你最少需要修改s中的多少个字符; 才能在t中匹配到s; [题解] O ...

  6. ECNUOJ 2855 贪吃蛇

    贪吃蛇 Time Limit:1000MS Memory Limit:65536KBTotal Submit:480 Accepted:109 Description  相信很多人都玩过这个游戏,当然 ...

  7. COGS——T 1215. [Tyvj Aug11] 冗余电网

    http://www.cogs.pro/cogs/problem/problem.php?pid=1215 ★   输入文件:ugrid.in   输出文件:ugrid.out   简单对比时间限制: ...

  8. HDFS 断点续传,写文件功能

    实际上这是个 HDFS 的工具类部分代码. 首先 public static Configuration configuration = null;public static FileSystem f ...

  9. BNU 34974 MATLAB大法好

    题目链接:http://www.bnuoj.com/bnuoj/problem_show.php?pid=34974 MATLAB大法好  Time Limit: 8000ms Memory Limi ...

  10. 把握linux内核设计思想(三):下半部机制之软中断

    [版权声明:尊重原创.转载请保留出处:blog.csdn.net/shallnet,文章仅供学习交流,请勿用于商业用途]         中断处理程序以异步方式执行,其会打断其它重要代码,其执行时该中 ...