当前位置:网站首页>CF514B Han Solo and Lazer Gun
CF514B Han Solo and Lazer Gun
2022-07-18 16:04:00 【༺Blog༒Hacker༻】
Personal profile
Hello everyone , I am a 2022 year 3 Ranked third in the rookie list in January ༺Blog༒Hacker༻
Stand by me : give the thumbs-up + Collection ️+ Leaving a message.
Maxim :༺ Always do high quality ༒programmer༻
Series column :CF & UVA
Personal home page :༺Blog༒Hacker༻️
notes ( Please refer to CF665B Shopping):
️ my Update time It's going to change , monthly 2-5 piece , Thank you for your long-term support !
CF514B Han Solo and Lazer Gun
️ Title Description
️There are n n n Imperial stormtroopers on the field. The battle field is a plane with Cartesian coordinate system. Each stormtrooper is associated with his coordinates ( x , y ) (x,y) (x,y) on this plane.
️Han Solo has the newest duplex lazer gun to fight these stormtroopers. It is situated at the point ( x 0 , y 0 ) (x_{0},y_{0}) (x0,y0). In one shot it can can destroy all the stormtroopers, situated on some line that crosses point ( x 0 , y 0 ) (x_{0},y_{0}) (x0,y0).
️Your task is to determine what minimum number of shots Han Solo needs to defeat all the stormtroopers.
️The gun is the newest invention, it shoots very quickly and even after a very large number of shots the stormtroopers don’t have enough time to realize what’s happening and change their location.



️ I/o sample
️ Input #1
4 0 0
1 1
2 2
2 0
-1 -1
️ Output #1
2
️ Input #2
2 1 2
1 1
1 0
️ Output #2
1
CODE
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
ll n,k=0,t=1;
double x_0,y_0,x,y,a[1005];
cin>>n>>x_0>>y_0;
for(int i=1;i<=n;++i)
{
cin>>x>>y;
if(x_0-x==0)
a[++k]=100000;
else
a[++k]=(y_0-y)/(x_0-x);
}
sort(a+1,a+k+1);
for(int i=1;i<k;++i)
if(a[i]!=a[i+1])
t++;
cout<<t;
return 0;
}

Thank you for your long-term support , Like collection is my motivation to update , See you next time , Bye-bye !!!
边栏推荐
- 助力开发者,全方位解读 APISIX 测试案例
- Interviewer: what are the methods of redis performance optimization?
- 重邮SYDTEK实习(一): 4k和BLE profile烧录
- uniapp扫码原生插件(Google MLKit、zxing;支持同时扫多个码)
- C language under custom type (enumeration, Union)
- Defi中的关键 智能合约是什么?
- 中关村e谷·苏高新承办2022苏州中日韩高层次人才项目路演大赛
- Apache stress testing tool AB, with post parameter and token request
- 全局变量、局部变量、静态变量和常量的地址分配
- 在okcc中你了解呼叫并发的含义吗?
猜你喜欢

社交网络的充分去中心化

ValueError: The number of FixedLocator locations (7), usually from a call to set_ ticks, does not mat

Introduction of some attention mechanisms in deep learning and implementation of pytorch code

okcc呼叫中心系统核心技术都有哪些

"Detective Conan" 1049 words painting collapse, the role of frequent "face changes"

基于多尺度残差密集块和块连接级联U-Net的真实图像去噪

助力开发者,全方位解读 APISIX 测试案例

MRP的基本任务是什么

CompressAI:基于pytorch的图像压缩框架使用

以Celsius为反面教材,手把手教大家判断产品好坏、避开投资风险
随机推荐
使用arcpy遇到的那些坑(三)
The pits encountered using arcpy (3)
Sword finger offer 46: Translate numbers into strings
网页制作(二)
okcc呼叫中心系统核心技术都有哪些
为健康增值,为时代赋能|仙乐健康发布年度可持续发展报告
Use tcpkill to block packets of the specified TCP connection
以Celsius为反面教材,手把手教大家判断产品好坏、避开投资风险
What is EOC
How to set up domain name resolution?
C语言实训通讯录(静态和动态版本)
Chengdu meetup | distributed database, a new engine for enterprises to reduce costs and increase efficiency
Which is the most suitable price system for the three cloud rendering platforms (I)
软件测试面试:请说一下你工作中发现的最有价值的bug?
ELK集群部署(九)之logstash过滤规则
From it R & D staff turnover thought
Joint Autoregressive and Hierarchical Priors for Learned Image Compression文献复现
What is the basic task of MRP
What is the composition of CPU
ELK集群部署(十)之ELK服务化