当前位置:网站首页>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:15:00 【Don't eat toast】
#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;
}
边栏推荐
- [camera topic] complete analysis of camera dtsi
- What are the key points often asked in the redis interview
- Where is the future of test engineers? Confused to see
- Introduce in detail how to communicate with Huawei cloud IOT through mqtt protocol
- In the face of difficult SQL requirements, HQL is not afraid
- His experience in choosing a startup company or a big Internet company may give you some inspiration
- Performance test | script template sorting, tool sorting and result analysis
- Y54. Chapter III kubernetes from introduction to mastery -- ingress (27)
- Technology sharing | Frida's powerful ability to realize hook functions
- Comment communiquer avec Huawei Cloud IOT via le Protocole mqtt
猜你喜欢

elastic stack

Deep learning notes (constantly updating...)

Stm32f407 ------- IIC communication protocol

SPI机制

线程安全的单例模式

What are the differences between software testers with a monthly salary of 7K and 25K? Leaders look up to you when they master it

In the face of difficult SQL requirements, HQL is not afraid

Visual yolov5 format data set (labelme JSON file)

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

Processing of tree structure data
随机推荐
微信小程序开发工具 POST net::ERR_PROXY_CONNECTION_FAILED 代理问题
深度(穿透)选择器 ::v-deep/deep/及 > > >
What are MySQL locks and classifications
My creation anniversary
[Yu Yue education] Jiujiang University material analysis and testing technology reference
苏世民:25条工作和生活原则
[fluent] fluent debugging (debug debugging window | viewing mobile phone log information | setting normal breakpoints | setting expression breakpoints)
Distributed transaction solution
Visualisation de l'ensemble de données au format yolov5 (fichier labelme json)
缺少库while loading shared libraries: libisl.so.15: cannot open shared object file: No such file
Groovy, "try with resources" construction alternative
《上市风云》荐书——唯勇气最可贵
Deep learning notes (constantly updating...)
[shutter] bottom navigation bar implementation (bottomnavigationbar bottom navigation bar | bottomnavigationbaritem navigation bar entry | pageview)
疫情當頭,作為Leader如何進行團隊的管理?| 社區征文
Button button adaptive size of wechat applet
详细些介绍如何通过MQTT协议和华为云物联网进行通信
How to refresh the opening amount of Oracle ERP
Stm32f407 ------- IIC communication protocol
502 (bad gateway) causes and Solutions