UVALive 6262 Darts
Description

Consider a game in which darts are thrown at a board. The board is formed by 10 circles with radii 20, 40, 60, 80, 100, 120, 140, 160, 180, and 200 (measured in millimeters), centered at the origin. Each throw is evaluated depending on where the dart hits the board. The score is p points (p {1, 2,..., 10}) if the smallest circle enclosing or passing through the hit point is the one with radius 20 . (11 - p). No points are awarded for a throw that misses the largest circle. Your task is to compute the total score of a series of n throws.
Input
The first line of the input contains the number of test cases T. The descriptions of the test cases follow:
Each test case starts with a line containing the number of throws n (1n
106). Each of the next n lines contains two integers x and y (- 200
x, y
200) separated by a space -- the coordinates of the point hit by a throw.
Output
Print the answers to the test cases in the order in which they appear in the input. For each test case print a single line containing one integer -- the sum of the scores of all n throws.
Sample Input
1
5
32 -39
71 89
-60 80
0 0
196 89
Sample Output
29
#include<iostream>
#include<string.h>
#include<stdio.h>
#include<ctype.h>
#include<algorithm>
#include<stack>
#include<queue>
#include<set>
#include<math.h>
#include<vector>
#include<map>
#include<deque>
#include<list>
using namespace std;
int d(int a,int b)
{
if(*<(pow(a,)+pow(b,)))
return ;
if(*<(pow(a,)+pow(b,))&&(pow(a,)+pow(b,)))
return ;
if(*<(pow(a,)+pow(b,))&&(pow(a,)+pow(b,)))
return ;
if(*<(pow(a,)+pow(b,))&&(pow(a,)+pow(b,)))
return ;
if(*<(pow(a,)+pow(b,))&&(pow(a,)+pow(b,)))
return ;
if(*<(pow(a,)+pow(b,))&&(pow(a,)+pow(b,)))
return ;
if(*<(pow(a,)+pow(b,))&&(pow(a,)+pow(b,)))
return ;
if(*<(pow(a,)+pow(b,))&&(pow(a,)+pow(b,)))
return ;
if(*<(pow(a,)+pow(b,))&&(pow(a,)+pow(b,)))
return ;
if(*<(pow(a,)+pow(b,))&&(pow(a,)+pow(b,)))
return ;
return ;
}
int main()
{
int n;
cin>>n;
while(n--)
{
int m,ans=;
cin>>m;
while(m--)
{
int a,b;
scanf("%d%d",&a,&b);
ans+=d(a,b);
}
printf("%d\n",ans);
}
return ;
}
UVALive 6262 Darts的更多相关文章
- UVALive - 4108 SKYLINE[线段树]
UVALive - 4108 SKYLINE Time Limit: 3000MS 64bit IO Format: %lld & %llu Submit Status uDebug ...
- UVALive - 3942 Remember the Word[树状数组]
UVALive - 3942 Remember the Word A potentiometer, or potmeter for short, is an electronic device wit ...
- UVALive - 3942 Remember the Word[Trie DP]
UVALive - 3942 Remember the Word Neal is very curious about combinatorial problems, and now here com ...
- 日本DARTS 支撑的一系列应用项目
DARTS是多学科空间科学数据平台,例如天体物理.太阳物理.太阳物理.月球与行星科学和微重力科学.在此数据支撑下,有许多应用. 1.http://wms.selene.darts.isas.jaxa. ...
- 思维 UVALive 3708 Graveyard
题目传送门 /* 题意:本来有n个雕塑,等间距的分布在圆周上,现在多了m个雕塑,问一共要移动多少距离: 思维题:认为一个雕塑不动,视为坐标0,其他点向最近的点移动,四舍五入判断,比例最后乘会10000 ...
- UVALive 6145 Version Controlled IDE(可持久化treap、rope)
题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_ ...
- UVALive 6508 Permutation Graphs
Permutation Graphs Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit ...
- UVALive 6500 Boxes
Boxes Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit Status Pract ...
- UVALive 6948 Jokewithpermutation dfs
题目链接:UVALive 6948 Jokewithpermutation 题意:给一串数字序列,没有空格,拆成从1到N的连续数列. dfs. 可以计算出N的值,也可以直接检验当前数组是否合法. # ...
随机推荐
- 25 个常用的 Linux iptables 规则【转】
转自 25 个常用的 Linux iptables 规则 - 文章 - 伯乐在线http://blog.jobbole.com/108468/ # 1. 删除所有现有规则 iptables -F # ...
- 查看linux服务器内存信息
查看服务器内存信息 dmidecode|grep -P -A5 "Memory\s+Device"|grep Size [root@localhost home]# dmideco ...
- jmeter之数据库
https://www.cnblogs.com/ShadowXie/p/6007515.html
- Java事务管理之Hibernate
环境与版本 Hibernate 版本:Hibernate 4.2.2 (下载后的文件名为hibernate-release-4.2.2.Final.zip,解压目录hibernate-release- ...
- Vue select 下拉菜单
1.html <div id="app-8"> <select v-model="selected"> <option v-for ...
- SQL Server中常用全局变量介绍
在SQL Server中,全局变量是一种特殊类型的变量,服务器将维护这些变量的值.全局变量以@@前缀开头,不必进行声明,它们属于系统定义的函数.下表就是SQL Server中一些常用的全局变量. 全局 ...
- JS中给函数参数添加默认值
最近在Codewars上面看到一道很好的题目,要求用JS写一个函数defaultArguments,用来给指定的函数的某些参数添加默认值.举例来说就是: // foo函数有一个参数,名为x var f ...
- Spring Boot整合JPA、Redis和Swagger2
好久没有总结了,最近也一直在学习.今天就把spring boot与其它技术的整合做个小总结,主要是jpa.redis和swagger2.公司里有用到这些,整合起来也很简单. 首先,新建一个Spring ...
- MyBatis的动态插入语句(经常报‘无效的列类型’)
最近在工作中经常遇到一个情况:通过mybatis的标签执行插入语句,当表中字段比较多的时候,需要全部插入,而有时候的需求是只插入其中几个字段,但是会报错. 原来的语句,必须把所有字段都Set值. &l ...
- Web前端开发最佳实践(10):JavaScript代码不好读,不好维护?你需要改变写代码的习惯
前言 这篇文章本应该在上一篇文章:使用更严格的JavaScript编码方式,提高代码质量之前发布,但当时觉得这篇文章太过基础,也就作罢.后来咨询了一些初级的开发者,他们觉得有必要把这篇文章也放上来.尽 ...