玲珑杯”ACM比赛 Round #4 G -- See car【Set】
来源:互联网 发布:无主之地前传改枪软件 编辑:程序博客网 时间:2024/05/22 13:29
玲珑杯”ACM比赛 Round #4
Start Time:2016-11-05 12:00:00 End Time:2016-11-05 17:00:00 Refresh Time:2016-11-06 21:50:19 Private
G -- See car
Time Limit:2s Memory Limit:64MByte
Submissions:578Solved:218
DESCRIPTION
You are the god of cars, standing at (a, b) point.There are some cars at point (xi,yi)(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>axi>a and yi>byi>b.
INPUT
There are multiple test cases.The first line is a number T (T ≤11 ≤11), which means the number of cases.For each case, first line has three integers a,b,n(−109≤a,b≤109,0≤n≤105)a,b,n(−109≤a,b≤109,0≤n≤105).nextnn lines, each line contains two integer (xi,yi)(−109≤xi,yi≤109)(xi,yi)(−109≤xi,yi≤109), which means the position of car.
OUTPUT
one line --- the number of car that you can see.
SAMPLE INPUT
20 0 31 1 2 23 30 0 41 12 22 34 6
SAMPLE OUTPUT
12
SOLUTION
“玲珑杯”ACM比赛 Round #4
AC代码:
#include<cstdio>#include<cstring>#include<algorithm>#include<set>using namespace std;typedef long long LL;const int MAXN=1e5+11;int main(){int T; scanf("%d",&T);while(T--) {int a,b,N; scanf("%d%d%d",&a,&b,&N);set<double> Se;for(int i=0;i<N;++i) {int x,y; scanf("%d%d",&x,&y);Se.insert((y-b)*1.0/(x-a));}printf("%d\n",Se.size());}return 0;}
0 0
- 玲珑杯”ACM比赛 Round #4 G -- See car【Set】
- “玲珑杯”ACM比赛 Round #4 G -- See car
- “玲珑杯”ACM比赛 Round #4 G -- See car【多种容器的运用】
- 玲珑杯1052 - See car——STL集合的应用(“玲珑杯”ACM比赛 Round #4 )
- 玲珑Round #4-G -- See car
- 【玲珑杯 1052】【暴力+set】See car
- “玲珑杯”ACM比赛 Round #4
- 玲珑杯-【See car】
- “玲珑杯”ACM比赛 Round #4 A -- chess play
- “玲珑杯”ACM比赛 Round #4 E -- array(dp)
- “玲珑杯”ACM比赛 Round #4 E题
- 玲珑杯”ACM比赛 Round #4 E -- array【DP】
- “玲珑杯”ACM比赛 Round #4 B Best couple
- 玲珑杯”ACM比赛 Round #5
- “玲珑杯”ACM比赛 Round #7
- “玲珑杯”ACM比赛 Round #7
- “玲珑杯”ACM比赛 Round #11 " ---1097
- “玲珑杯”ACM比赛 Round #11 D
- 位运算与小数的二进制表示
- Maven介绍,包括作用、核心概念、用法、常用命令、扩展及配置
- 位运算
- git command
- 按位“或”赋值运算符 (|=)
- 玲珑杯”ACM比赛 Round #4 G -- See car【Set】
- JAVA应用JVM原理及参数调优笔记
- C语言求1-100以内的素数
- 比较数组移位问题的三种方法
- 统计学生信息
- VR学习第十节:VR+医疗 VR+教育 VR+军事
- 父母的交流
- IPTV人物志几个问题
- SQLite数据库文件格式逐字节详解