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;
}

时间: 2024-10-09 16:13:41

1795. Table tennis的相关文章

CF765C Table Tennis Game 2

题意: Misha and Vanya have played several table tennis sets. Each set consists of several serves, each serve is won by one of the players, he receives one point and the loser receives nothing. Once one of the players scores exactly k points, the score

Codeforces Round #397 by Kaspersky Lab and Barcelona Bootcamp (Div. 1 + Div. 2 combined) C - Table Tennis Game 2

地址:http://codeforces.com/contest/765/problem/C 题目: C. Table Tennis Game 2 time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output Misha and Vanya have played several table tennis sets. Each set co

1026. Table Tennis (30)

A table tennis club has N tables available to the public. The tables are numbered from 1 to N. For any pair of players, if there are some tables open when they arrive, they will be assigned to the available table with the smallest number. If all the

浙大 PAT Advanced level 1026. Table Tennis (30)

A table tennis club has N tables available to the public. The tables are numbered from 1 to N. For any pair of players, if there are some tables open when they arrive, they will be assigned to the available table with the smallest number. If all the

Pat(Advanced Level)Practice--1026(Table Tennis)

Pat1026代码 题目描写叙述: A table tennis club has N tables available to the public. The tables are numbered from 1 to N. For any pair of players, if there are some tables open when they arrive, they will be assigned to the available table with the smallest n

@@443 B. Table Tennis

n people are standing in a line to play table tennis. At first, the first two players in the line play a game. Then the loser goes to the end of the line, and the winner plays with the next person from the line, and so on. They play until someone win

1026 Table Tennis (30 分)

1026 Table Tennis (30 分) A table tennis club has N tables available to the public. The tables are numbered from 1 to N. For any pair of players, if there are some tables open when they arrive, they will be assigned to the available table with the sma

PAT甲级1026 Table Tennis【模拟好题】

题目:https://pintia.cn/problem-sets/994805342720868352/problems/994805472333250560 题意: 有k张乒乓球桌,有的是vip桌.有n对玩家来打乒乓,有的玩家是VIP玩家. 当他们到达时,如果没有空桌子他们就排队等待. 这时候如果有VIP桌子空出来了,那么就优先给队列里的VIP玩家,如果没有VIP玩家就给普通玩家. 如果普通桌子空出来了,就给队列里排在最前的玩家. 如果玩家到达的时候有好多桌子可以选择,那么他会选择桌号最小的

PAT (Advanced Level) 1026. Table Tennis (30)

情况比较多的模拟题. 交了50发的样子才AC......AC之后我的天空星星都亮了. #include<iostream> #include<cstring> #include<cmath> #include<algorithm> #include<cstdio> #include<map> #include<queue> #include<vector> using namespace std; struct