玲珑学院 1052 - See car
Time Limit:2s Memory Limit:64MByte
Submissions:594Solved:227
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;

#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的更多相关文章
- 玲珑学院-ACM比赛1014 - Absolute Defeat
1014 - Absolute Defeat Time Limit:2s Memory Limit:64MByte Submissions:257Solved:73 DESCRIPTION Eric ...
- 玲珑学院oj 1152 概率dp
1152 - Expected value of the expression Time Limit:2s Memory Limit:128MByte Submissions:128Solved:63 ...
- 玲珑学院1072 【DFS】
蛤蛤,略蠢. priority_queue 自定义优先级 和排序是反的 struct node { int x,y; friend bool operator< (node a,node b) ...
- 玲珑学院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 ...
- 玲珑学院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> ...
- 玲珑学院 1010 - Alarm
1010 - Alarm Time Limit:1s Memory Limit:128MByte DESCRIPTION Given a number sequence [3,7,22,45,116, ...
- 玲珑学院 1050 - array
1050 - array Time Limit:3s Memory Limit:64MByte Submissions:494Solved:155 DESCRIPTION 2 array is an ...
- 玲珑学院 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 ...
- 强强联合,Testin云测&云层天咨众测学院开课了!
Testin&云层天咨众测学院开课了! 共享经济时代,测试如何赶上大潮,利用碎片时间给女票或者自己赚点化妆品钱? 2016年12月13日,Testin联手云层天咨带领大家一起推开众测的大门 ...
随机推荐
- ubuntu配置上网
一.通过修改配置文件配置: 编辑配置文件: #sudo vim /etc/network/interfaces auto ens33 #没有这句网卡不能启动 iface ens33 i ...
- [ZJOI2012]旅游 对偶图 树的直径
Code: // luogu-judger-enable-o2 #include<cstdio> #include<iostream> #include<algorith ...
- win10如何设置开机自动启动热点WIFI?
1.编写脚本文件(先新建txt文件,编写代码内容netsh wlan start hostednetwork,最后重命名成HotSpot.bat):文件名称:HotSpot.bat,代码内容: net ...
- 如何使用Java创建Excel(.xls 和 .xlsx)文件 并写入数据
1,需要依赖的jar包, <!-- POI(operate excel) start --> <!-- the version of the following POI packag ...
- django-xadmin使用之配置页眉页脚
环境:xadmin-for-python3 python3.5.2 django1.9.12 在模块的adminx.py文件中增加以下代码即可: # TIP 定义页头页脚 class GlobalSe ...
- uva 473(dp)
题意:按创作时间给出n首歌每首歌的时间ti,然后按创作时间装到m个光盘内,给出光盘最大分钟数t,问m个光盘最多总共放多少首歌. 题解:对于每首歌都能够选或者不选,假设选择了这首歌,是否把这首歌当做第j ...
- C语言keywordstatic的绝妙用途
为什么要说static妙,它确实是妙,在软件开发或者单片机开发过程中,大家总以为static就是一个静态变量.在变量类型的前面加上就自己主动清0了.还有就是加上statickeyword的,无论是变量 ...
- VS链接数据库
可以用VS链接数据库,并进行数据库操作.前提是安装了Sqlserver,活着连接线上的数据库服务器.
- 融云消息接口apicloud
融云提供消息发送服务,支持个人消息,群消息,讨论组,聊天室消息, 以下是它涉及到的接口. 初始化,连接之后,可以使用. <!DOCTYPE html> <html> <h ...
- 81.node.js前端html时页面格式错乱解决办法
var http = require("http"); var url = require("url"); var fs = require("fs& ...