当前位置:网站首页>Codeforces Round #418 (Div. 2) D. An overnight dance in discotheque
Codeforces Round #418 (Div. 2) D. An overnight dance in discotheque
2022-07-03 02:05:00 【不吃土司边】
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <vector>
#include <math.h>
#include <bitset>
#include <algorithm>
using namespace std;
#define X first
#define Y second
#define eps 1e-2
#define gcd __gcd
#define pb push_back
#define PI acos(-1.0)
#define lowbit(x) (x)&(-x)
#define bug printf("!!!!!\n");
#define mem(x,y) memset(x,y,sizeof(x))
typedef long long LL;
typedef long double LD;
typedef pair<int,int> pii;
typedef unsigned long long uLL;
const int N = 1e5+2;
const int INF = 1<<30;
const int mod = 1e9+7;
int n;
struct node
{
double x,y,r;
int times;
bool operator <(const node &b) const {
return (x-b.x)*(x-b.x)+(y-b.y)*(y-b.y)<b.r*b.r&&r<b.r;
}
}p[N];
double getd(node a){
return a.r*a.r*PI;
}
void solve(){
scanf("%d",&n);
for(int i=1;i<=n;i++){
double x,y,r;scanf("%lf%lf%lf",&x,&y,&r);
p[i]={
x,y,r};
}
double ans=0;
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
if(i!=j){
if(p[i]<p[j]) p[i].times++;
}
}
}
for(int i=1;i<=n;i++){
// cout<<p[i].times<<" "<<i<<endl;
if(p[i].times==0||p[i].times&1) ans+=getd(p[i]);
else ans-=getd(p[i]);
}
printf("%0.9lf\n",ans);
return;
}
int main()
{
// freopen("in.txt","r",stdin);
// freopen("out.txt","w",stdout);
// ios::sync_with_stdio(false);
int t = 1;
//scanf("%d",&t);
while(t--){
// printf("Case %d: ",cas++);
solve();
}
return 0;
}
边栏推荐
- 树形结构数据的处理
- The Sandbox阐释对元宇宙平台的愿景
- Distributed transaction solution
- es6 filter() 数组过滤方法总结
- A 30-year-old software tester, who has been unemployed for 4 months, is confused and doesn't know what to do?
- MySQL learning 03
- How to deal with cache hot key in redis
- Reprint some Qt development experience written by great Xia 6.5
- File class (add / delete)
- [leetcode] 797 and 1189 (basis of graph theory)
猜你喜欢
詳細些介紹如何通過MQTT協議和華為雲物聯網進行通信
深度学习笔记(持续更新中。。。)
stm32F407-------DMA
Redis: simple use of redis
Solution for processing overtime orders (Overtime unpaid)
[camera topic] complete analysis of camera dtsi
What are MySQL locks and classifications
How can retail enterprises open the second growth curve under the full link digital transformation
Hard core observation 547 large neural network may be beginning to become aware?
What are the differences between software testers with a monthly salary of 7K and 25K? Leaders look up to you when they master it
随机推荐
Y54. Chapter III kubernetes from introduction to mastery -- ingress (27)
人脸识别6- face_recognition_py-基于OpenCV使用Haar级联与dlib库进行人脸检测及实时跟踪
[shutter] hero animation (hero realizes radial animation | hero component createrecttween setting)
2022 spring "golden three silver four" job hopping prerequisites: Software Test interview questions (with answers)
DDL basic operation
es6 filter() 数组过滤方法总结
缺少库while loading shared libraries: libisl.so.15: cannot open shared object file: No such file
Reprint some Qt development experience written by great Xia 6.5
Coroutinecontext in kotlin
In the face of difficult SQL requirements, HQL is not afraid
Method of removing webpage scroll bar and inner and outer margins
How to find summer technical internship in junior year? Are you looking for a large company or a small company for technical internship?
Analysis, use and extension of open source API gateway apisex
Redis:Redis的简单使用
全链路数字化转型下,零售企业如何打开第二增长曲线
The Sandbox阐释对元宇宙平台的愿景
【Camera专题】手把手撸一份驱动 到 点亮Camera
小程序开发黑马购物商城中遇到的问题
Depth (penetration) selector:: v-deep/deep/ and > > >
树形结构数据的处理