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 ...
随机推荐
- Android内购订单验证 --- nodejs实现
主代码: function AndroidPlayVerify(inappPurchaseData, inappDataSignature) { let verify = crypto.createV ...
- strak组件(8):基本增删改查实现及应用和排序
效果图: 新增函数: def reverse_common_url(self, name, *args, **kwargs) 反向生成url,需要传增删改的url作为参数,携带原参数 def reve ...
- python 函数的嵌套 和 作用域链
# def max(a,b): # return a if a>b else b # # def the_max(x,y,z): #函数的嵌套调用 # c = max(x,y) # return ...
- 1,Python常用库之一:Numpy
Numpy支持大量的维度数组和矩阵运算,对数组运算提供了大量的数学函数库! Numpy比Python列表更具优势,其中一个优势便是速度.在对大型数组执行操作时,Numpy的速度比Python列表的速度 ...
- android onNewIntent 为什么要在onNewIntent的时候要显示的去调用setIntent
原因: 当调用到onNewIntent(intent)的时候,需要在onNewIntent() 中使用setIntent(intent)赋值给Activity的Intent.否则,后续的getInte ...
- oracle(sql)基础篇系列(二)——多表连接查询、子查询、视图
多表连接查询 内连接(inner join) 目的:将多张表中能通过链接谓词或者链接运算符连接起来的数据查询出来. 等值连接(join...on(...=...)) --选出雇员的名字和雇员所在的部门 ...
- videomon 环境搭建
1.安装ACE-5.8.0.tar.bz2 tar -zxvf ACE-.tar.bz2 cd ACE_wrappers/mkdir buildcd build../configuremake &am ...
- 2.ifconfig
转载http://www.cnblogs.com/peida/archive/2013/02/27/2934525.html 许多windows非常熟悉ipconfig命令行工具,它被用来获取网络接口 ...
- Win10开始菜单中的天气不更新问题的解决方法
两台电脑同时做的Win10系统,最新的1703 Creator Update 版本,其中一台的开始菜单中天气方块总是显示图标,试了各种方法都不行,最后是点开天气App,在App的顶端有几个按钮,其中有 ...
- 剑指Offer - 九度1524 - 复杂链表的复制
剑指Offer - 九度1524 - 复杂链表的复制2014-02-07 01:30 题目描述: 输入一个复杂链表(每个节点中有节点值,以及两个指针,一个指向下一个节点,另一个特殊指针指向任意一个节点 ...