URAL 1942 Attack at the Orbit
Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u
Description
Input
Output
Sample Input
| input | output |
|---|---|
3 |
2 0.53852 |
2 |
2 0.00000 |
#include<stdio.h>
#include<string.h>
#include<iostream>
#include<math.h>
#include<algorithm> using namespace std;
int sum[][];
const double esp=1e-;
int dis(int x,int y){
int xx=min(x,-x);
int yy=min(y,-y);
return xx*xx+yy*yy;
}
int main(){
int n;
while(scanf("%d",&n)!=EOF){
memset(sum,,sizeof(sum));
double x,y;
for(int i=;i<=n;i++){
scanf("%lf%lf",&x,&y);
int tx=(int)(round(x*))%;
int ty=(int)(round(y*))%;
if(tx<)
tx+=;
if(ty<)
ty+=;
sum[tx][ty]++;
}
int ans1=,ans2=;
for(int i=;i<=;i++){
for(int j=;j<=;j++){
if(sum[i][j]>ans1){
ans1=sum[i][j];
ans2=dis(i,j);
}
else if(sum[i][j]==ans1&&dis(i,j)<ans2){
ans2=dis(i,j); }
}
}
printf("%d %.5lf\n",ans1,sqrt(ans2*esp)); }
return ;
}
URAL 1942 Attack at the Orbit的更多相关文章
- bnuoj 27987 Record of the Attack at the Orbit (模拟)
http://www.bnuoj.com/bnuoj/problem_show.php?pid=27987 [题意]:给定坐标输出图形 [题解]:处理坐标上的小技巧 [code]: #include ...
- URAL 1944 大水题模拟
D - Record of the Attack at the Orbit Time Limit:1000MS Memory Limit:65536KB 64bit IO Format ...
- UDP flood UDP Port Denial-of-Service Attack
https://baike.baidu.com/item/UDP%20flood/5504851 UDPFlood是日渐猖厥的流量型DoS攻击,原理也很简单.常见的情况是利用大量UDP小包冲击DNS服 ...
- URAL 1141. RSA Attack RSA加密演算法
标题来源:URAL 1141. RSA Attack 意甲冠军:给你e n c 并有m^e = c(mod n) 求 m 思路:首先学习RSA算法 here 过程大致是 1.发送的信息是m 2.随机选 ...
- ****ural 1141. RSA Attack(RSA加密,扩展欧几里得算法)
1141. RSA Attack Time limit: 1.0 secondMemory limit: 64 MB The RSA problem is the following: given a ...
- URAL 1557 Network Attack 图论,连通性,tarjain,dfs建树,分类讨论 难度:2
http://acm.timus.ru/problem.aspx?space=1&num=1557 1557. Network Attack Time limit: 2.0 secondMem ...
- URAL 1141. RSA Attack(欧拉定理+扩展欧几里得+快速幂模)
题目链接 题意 : 给你n,e,c,并且知道me ≡ c (mod n),而且n = p*q,pq都为素数. 思路 : 这道题的确与题目名字很相符,是个RSA算法,目前地球上最重要的加密算法.RSA算 ...
- Ural 1197 - Lonesome Knight
The statement of this problem is very simple: you are to determine how many squares of the chessboar ...
- 8 Best DDoS Attack Tools (Free DDoS Tool Of The Year 2019)
#1) HULK Description: HULK stands for HTTP Unbearable Load King. It is a DoS attack tool for the web ...
随机推荐
- 【洛谷P1948】[USACO08JAN]电话线
电话线 题目链接:https://www.luogu.org/problemnew/show/P1948 二分答案+最短路 我们要求一条1~n的路径,使其中的第k+1大的数最小. 二分第k+1大的数的 ...
- getnumdevices.c && setgetdevicetype例程
getnumdevices.c代码 /* 文件名: getnumdevices.c * 功能 : 测试函数acc_get_num_devices(.) */ #include<stdio.h&g ...
- 基于Jquery的原生态dialog弹出窗口-zapWindow
看到boss系统搓B的填出窗口,不忍直视,坚决的换掉! 采用zapwindow(来源不清楚了,总之是前人留下的),做了修改,当前支持三类弹出类型: 1. 指定url 2. 自定义html 3. 指定D ...
- java乱码问题
我们知道JSP页面是需要转换为servlet的,在转换过程中肯定是要进行编码的.在JSP转换为servlet过程中下面一段代码起到至关重要的作用. <%@ page language=" ...
- 小程序weapp的状态管理 Wenaox
Wenaox wechat state management 特点 支持中间件 中大型项目可多个 contro 区分模块 asyncs 自带 loading 轻量.性能好 安装 npm i -S we ...
- 微信小程序开发踩坑与总结 -
原文链接:https://segmentfault.com/a/1190000008516296 前段时间把公司小程序项目开发完成了,所以来写写自己开发过程中碰到的问题和解决方法,以及用到的提高效率的 ...
- Percona-Tookit工具包之pt-pmp
Preface Sometimes we need to know the details of a program(porcess) when it is running even ...
- HTML语义化的重要性
语义化标签就是尽量使用有相对应的结构的含义的Html的标签 1.结构更好,更利于搜索引擎的抓取(SEO的优化)和开发人员的维护(可维护性更高,因为结构清晰,so易于阅读). 2.更有利于特殊终端的阅读 ...
- Python全栈day 05
Python全栈day 05 一.数据类型补充 1. int py2和py3的2种区别 py2有int和long,int的取值范围为-2^31~2^31-1,超出范围自动转为long,长整型. py2 ...
- C++ 基础 初始化列表
当一个类组合了其他类,或者使用了 const 成员,就要用 初始化列表. Class A {...}; Class B {...}; Class C { private: A a; B b; int ...