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 ...
随机推荐
- P2082 区间覆盖(加强版)
题目 #include<iostream> #include<algorithm> #include<cstring> using namespace std; s ...
- ajax模仿form上传图片
<form id="iconForm"> <input class="js_upFile cover1" type="file&qu ...
- this指向问题(2)
4.显示绑定 指的是apply.bind.call (1).apply 和 call 相同点: <1> 这两个方法的用途是在特定的作用域中调用函数,实际上等于设置函数体内 this 对象的 ...
- 如何将一个div水平垂直居中
方案一: div绝对定位水平垂直居中[margin:auto实现绝对定位元素的居中], 兼容性:,IE7及之前版本不支持 div{ width: 200px; height: 200px; backg ...
- Windosw系统——常见的问题
1. 写在某些软件后就无法打开网页,但可以上QQ. 在卸载了一些VPN或USB无线设备后,发现自己网页打不开,但是ping能ping通,也可以登录QQ. 解决办法: (1): 开始运行——regedi ...
- docker-compose 构建mongodb并导入基础数据示例
使用docker-compose构建mongodb服务并导入基础数据示例. 1.文件目录结构 ——mongo/ |——docker-compose.yml |——mongo-Dockerfile |— ...
- 用Java读取xml文件内容
在AXP中,DOM解析器是1 Document Builder类的一个实例,该实例由 DocumenBailderfactorv类负责创,步如下 DocumentBuilderFactory fa ...
- JS - 给String.prototype添加replaceAll方法
String.prototype.replaceAll = function (targetStr, newStr) { var sourceStr = this.valueOf(); while ...
- Windows下安装Python数据库模块--MySQLdb
## 1.下载MySQLdb [去官网](http://pypi.python.org/pypi/MySQL-python/) 下载对应的编译好的版本(现在官网最新版本为1.2.5): MySQL-p ...
- php mysql find_in_set函数 检索单子段 逗号分隔序列
FIND_IN_SET($kwd,field) 例如在 表 AA中 numbers 字段 保存列数据 1,4,8,75,41,7 就可以使用 FIND_IN_SET(8,numbers) 查询记 ...