玲珑学院 1052 - See car

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=1;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 0;
}

时间: 2024-08-05 15:16:31

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

玲珑学院 1128 咸鱼拷问

1128 - 咸鱼拷问 Time Limit:3s Memory Limit:128MByte Submissions:367Solved:112 DESCRIPTION 给你两个序列A,B.每个序列有N个元素,我们定义第i个位置的咸鱼值为min(A[i],A[i-1]-A[i-B[i]+1])*max(A[i],A[i-1]-.A[i-B[i]+1]).. 现在咸鱼王想知道所有的咸鱼值,于是抓住了你,让你回答这道题.你能回答他吗? INPUT 第一行包括一个整数N(1<=N<=1e5) 第二

玲珑学院 1127 咸鱼文章

1127 - 咸鱼文章 Time Limit:1s Memory Limit:128MByte Submissions:474Solved:196 DESCRIPTION elttiL moT nwod eht teerts sllac ruo god " ehT peek god " . piZ si a peehs god . tuB nehw moT seirt ot yas " peeS " , ti semoc tuo " peek "

玲珑学院 1138 - 震惊,99%+的中国人都会算错的问题

1138 - 震惊,99%+的中国人都会算错的问题 Time Limit:4s Memory Limit:128MByte Submissions:310Solved:87 DESCRIPTION 众所周知zhu是一个大厨,zhu一直有自己独特的咸鱼制作技巧.tang是一个咸鱼供应商,他告诉zhu在他那里面有N 条咸鱼(标号从1到N)可以被用来制作.每条咸鱼都有一个咸鱼值Ki,初始时Ki都是0:zhu是一个特别的人,他又M个咸数(咸鱼数字),对于每个咸数x,他都会满足所有标号是x倍数的咸鱼的咸鱼

玲珑学院 1149 - Buildings

题意:给出N,k,长度为N的数列,问有多少个区间满足区间最大值-区间最小值<=k 思路:RMQ+二分 1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 const int N=2e5+10; 5 int a[N],b[N]; 6 int dp1[N][20],dp2[N][20]; 7 int n,k; 8 9 void init(){ 10 memset(dp2,127,sizeof(d

玲珑学院 1050 - array

1050 - array Time Limit:3s Memory Limit:64MByte Submissions:494Solved:155 DESCRIPTION 2 array is an array, which looks like: 1,2,4,8,16,32,64......a1=1 ,a[i+1]/a[i]=2; Give you a number array, and your mission is to get the number of subsequences ,wh

玲珑学院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> #include <cstring> #include <queue> #include <cmath> #include <algorithm> using namespace std; typedef long long LL; const int N =

玲珑学院 1010 - Alarm

1010 - Alarm Time Limit:1s Memory Limit:128MByte DESCRIPTION Given a number sequence [3,7,22,45,116,...] . Please tell me the k -th number. INPUT A number T (T<100) indicates the number of the input cases. Then for each case there only is one integer

玲珑学院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/problem/1023 吐槽:这个题本来是mod(2^40),明显要用快速乘啊,但是用了以后狂T,不用反而过了,不懂出题人 #include <iostream> #include <algorithm> #include <cmath> #include <vector&g

玲珑歌舞

自传35.在佳木斯市委党校五----清水山花 一九八九年九月我在佳木斯市委党校经济学教研室工作第五学年.珍香在市运管处上班离小夜莺歌舞厅很近每天早上我俩前去联欢.儿子上黑大二年级未受社会风波影响坚持安心读书思想政治进步.女儿上二中高三学习紧张每天夜自习后我都去接陪回家以保安全. 上学期我讲的课有物价学152学时工商局大专班和税务局大专班. 农村商品经济56学时乡镇长班企业经济法规32学时县处青干班. 专题有我国当前多种所有制的基本经济制度8学时县处班青干班. 有二人合讲继续深化改革和扩大开放开放