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的值,也可以直接检验当前数组是否合法. # ...
随机推荐
- K/V式枚举
public enum OType { LOGIN { public String getDesc() { return "登录"; } }, ADD { public Strin ...
- maven bat脚本打包
脚本内容: @echo off echo 正在设置临时环境变量 set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_45 set MAVEN_HOME=D:\ap ...
- mariadb/mysql使用Navicat连接报错
[问题1] 使用Navicat连接服务器的mariadb/mysql时报错 access denied for user root@192.168.xx.xx(using password:yes) ...
- Codeforces Round #408 (Div. 2)C. Bank Hacking(STL)
题目链接:http://codeforces.com/problemset/problem/796/C 题目大意:有n家银行,第一次可以攻击任意一家银行(能量低于自身),跟被攻击银行相邻或者间接相邻( ...
- C++之插入迭代器
#include<iostream> #include<vector> #include<list> #include<iterator> usingn ...
- 20165301 2017-2018-2《Java程序设计》课程总结
20165301 2017-2018-2<Java程序设计>课程总结 每周作业链接汇总 预备作业1:我期待的师生关系 预备作业2:学习基础与c语言学习心得 预备作业3: Linux安装及命 ...
- MySql数据库 主从复制/共享 报错
从 获取不到 共享主的数据, 错误信息: Waiting for master to send event 解决方案: // 1. 从V表获取PrNo的数据 select * from Vendor_ ...
- webpack性能优化-实战
题外话:年初项目重构上线,项目技术栈使用vue+webpack,测试执行整个打包流程需要10分钟,同时又因涉及三个渠道,部署好环境就需半个小时,这严重延误了上线进度,因此提高webpack构建效率,成 ...
- VMware虚拟机的三种联网方法及原理(转)
转自:http://blog.chinaunix.net/uid-24876683-id-3593774.html 一.Brigde——桥接 :默认使用VMnet0 .原理: Bridge 桥&quo ...
- Python *args **kw
当函数的参数不确定时,可以使用*args 和**kwargs,*args 没有key值,**kwargs有key值. *args def fun_var_args(farg, *args): prin ...