sicily 1795.Table tennis

来源:互联网 发布:idle python gui好用吗 编辑:程序博客网 时间:2024/05/21 22:32
#include <iostream>using namespace std;int main(){int caseNum;cin >> caseNum;while(caseNum--){int n;int x;int y;cin >> n;int score = 0;for(int i = 0;i < n;i++){cin >> x >> y;//计算得分int dis1 = (x - 30) * (x - 30) + (y - 30) * (y - 30) - 400;int dis2 = (x - 100) * (x - 100) + (y - 30) * (y - 30) - 100;int dis3 = (x - 170) * (x - 170) + (y - 30) * (y - 30) - 25;if(dis1 < 0)score += 1;else if(dis2 < 0)score += 2;else if(dis3 < 0)score += 3;}cout << score << endl;}return 0;}

0 0
原创粉丝点击