当前位置:网站首页>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;
}
边栏推荐
- [shutter] top navigation bar implementation (scaffold | defaulttabcontroller | tabbar | tab | tabbarview)
- Missing library while loading shared libraries: libisl so. 15: cannot open shared object file: No such file
- stm32F407-------DMA
- [Yu Yue education] reference materials of love psychology of China University of mining and technology
- Leetcode (540) -- a single element in an ordered array
- When the epidemic comes, how to manage the team as a leader| Community essay solicitation
- 人脸识别6- face_recognition_py-基于OpenCV使用Haar级联与dlib库进行人脸检测及实时跟踪
- Swift开发学习
- CFdiv2-Fixed Point Guessing-(区间答案二分)
- Use go language to realize try{}catch{}finally
猜你喜欢

Analysis, use and extension of open source API gateway apisex

Visual yolov5 format data set (labelme JSON file)

Query product cases - page rendering data

Certaines fonctionnalités du développement d'applets

y54.第三章 Kubernetes从入门到精通 -- ingress(二七)

Technology sharing | Frida's powerful ability to realize hook functions

Huakaiyun (Zhiyin) | virtual host: what is a virtual host

A 30-year-old software tester, who has been unemployed for 4 months, is confused and doesn't know what to do?

Detailed introduction to the usage of Nacos configuration center

Button button adaptive size of wechat applet
随机推荐
File class (add / delete)
Processing of tree structure data
[fluent] hero animation (hero animation use process | create hero animation core components | create source page | create destination page | page Jump)
[shutter] hero animation (hero realizes radial animation | hero component createrecttween setting)
Asian Games countdown! AI target detection helps host the Asian Games!
可視化yolov5格式數據集(labelme json文件)
Detailed introduction to the deployment and usage of the Nacos registry
A 30-year-old software tester, who has been unemployed for 4 months, is confused and doesn't know what to do?
Internal connection query and external connection
Redis: simple use of redis
Distributed transaction solution
Everything file search tool
机器学习笔记(持续更新中。。。)
疫情當頭,作為Leader如何進行團隊的管理?| 社區征文
【Camera专题】HAL层-addChannel和startChannel简析
DQL basic operation
MySQL learning 03
Cfdiv2 fixed point guessing- (interval answer two points)
Caused by: com. fasterxml. jackson. databind. exc.MismatchedInputException: Cannot construct instance o
require.context