1795. Table tennis
#include<iostream>
#include<cmath>
using namespace std;
int main(){
int n;
cin>>n;
while(n--){
int t;
cin>>t;
int points=0;
while(t--){
int a,b;
cin>>a>>b;
if((a>10&&a<50)&&(b>10&&b<50)){
if(pow(a-30,2)+pow(b-30,2)<400)
points+=1;
}
if((a>90&&a<110)&&b>20&&b<40) {
if(pow(a-100,2)+pow(b-30,2)<100) points+=2;
}
if((a>165&&a<175)&&b>25&&b<35){
if(pow(a-170,2)+pow(b-30,2)<25) points+=3;
}
}
cout<<points<<endl;
}
return 0;
}
1795. Table tennis的更多相关文章
- PAT 1026. Table Tennis
A table tennis club has N tables available to the public. The tables are numbered from 1 to N. For ...
- 1026. Table Tennis (30)
题目如下: A table tennis club has N tables available to the public. The tables are numbered from 1 to N. ...
- PAT A1026 Table Tennis (30 分)——队列
A table tennis club has N tables available to the public. The tables are numbered from 1 to N. For a ...
- Codeforces Round #397 by Kaspersky Lab and Barcelona Bootcamp (Div. 1 + Div. 2 combined) C. Table Tennis Game 2 水题
C. Table Tennis Game 2 题目连接: http://codeforces.com/contest/765/problem/C Description Misha and Vanya ...
- PAT 1026 Table Tennis[比较难]
1026 Table Tennis (30)(30 分) A table tennis club has N tables available to the public. The tables ar ...
- 443 B. Table Tennis
http://codeforces.com/contest/879/problem/B n people are standing in a line to play table tennis. At ...
- Table Tennis Game 2(找规律)
Description Misha and Vanya have played several table tennis sets. Each set consists of several serv ...
- PAT甲级1026. Table Tennis
PAT甲级1026. Table Tennis 题意: 乒乓球俱乐部有N张桌子供公众使用.表的编号从1到N.对于任何一对玩家,如果有一些表在到达时打开,它们将被分配给具有最小数字的可用表.如果所有的表 ...
- PAT 甲级 1026 Table Tennis(模拟)
1026. Table Tennis (30) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue A table ...
随机推荐
- java byte转无符号int
import java.io.ByteArrayInputStream; public class Test{ public static void main(String[] args) { byt ...
- tmp_table_size
Whenever you increase tmp_table_size and max_heap_table_size, keep in mind that setting these does n ...
- IDEA新建javaWeb以及Servlet简单实现
刚开始用IDEA开发,还不太熟悉,因此写一个教程,加深印象 1.新建一个Web项目 两种方法:java 和 Java Enterprise(推荐) 第一种)通过Java工程创建,这个方法需要手动导入T ...
- Git服务器、http协议及XCode
本来费了老鼻子牛劲搭好了SVN,可以通过web进行访问,也弄好了eclipse和XCode,结果几个开发的同事说要上git,悲了个催,又开始折腾git. 因为公司只有一个公网的http出口,因此开始了 ...
- C# 指定物理目录下载文件,Response.End导致“正在中止线程”异常的问题
FileHandler http://www.cnblogs.com/vipsoft/p/3627709.html UpdatePanel无法导出下载文件: http://www.cnblogs.co ...
- java 代码判断图片格式后缀名称
/** * 图片判断 */ private static String getFormatName(Object o) { try { // Create an image input stream ...
- javascript垃圾回收机制
js中垃圾回收的算法一般包括两种,一种是“清除标记”,另一种是“引用计数”,现在较为流行的是第一种. “引用计数”现在基本已经被抛弃,主要原因是会导致循环引用,从而导致严重的问题(ie9之前的版本DO ...
- Linux:ssh连接服务器很慢
ssh连接服务器,如果很慢,可以进行如下处理: vi /etc/ssh/sshd_config#UseDNS yes改成:UseDNS no/etc/init.d/sshd restart ----- ...
- jenkins+findbugs
1) Jenkins安装findbugs插件 具体安装步骤:在主页面进入系统管理 选择插件管理 在过滤器中找出要安装的插件,并进行安装(Static Analysis Utilities.findb ...
- MAT内存问题分析定位
MAT内存问题分析定位 1.下载安装MemoryAnalyzer工具. 2.使用DDMS将对应线程的内存日志导出来后,使用hprof-conv工具进行转换,用MAT打开转换后的hprof文件.