当前位置:网站首页>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;
}
边栏推荐
- 深度(穿透)选择器 ::v-deep/deep/及 > > >
- In 2022, 95% of the three most common misunderstandings in software testing were recruited. Are you that 5%?
- The technology boss is ready, and the topic of position C is up to you
- MySQL学习03
- [camera topic] complete analysis of camera dtsi
- Coroutinecontext in kotlin
- elastic stack
- Redis: simple use of redis
- 小程序開發的部分功能
- 力扣(LeetCode)183. 从不订购的客户(2022.07.02)
猜你喜欢

Introduce in detail how to communicate with Huawei cloud IOT through mqtt protocol

Performance test | script template sorting, tool sorting and result analysis

Depth (penetration) selector:: v-deep/deep/ and > > >

Machine learning notes (constantly updating...)

【Camera专题】OTP数据如何保存在自定义节点中

His experience in choosing a startup company or a big Internet company may give you some inspiration

Custom components, using NPM packages, global data sharing, subcontracting

Distributed transaction solution

Deep learning notes (constantly updating...)
![[fluent] hero animation (hero animation use process | create hero animation core components | create source page | create destination page | page Jump)](/img/68/65b8c0530cfdc92ba4f583b0162544.gif)
[fluent] hero animation (hero animation use process | create hero animation core components | create source page | create destination page | page Jump)
随机推荐
Everything file search tool
Summary of ES6 filter() array filtering methods
机器学习笔记(持续更新中。。。)
easyExcel
Query product cases - page rendering data
深度(穿透)选择器 ::v-deep/deep/及 > > >
Stm32f407 ------- IIC communication protocol
詳細些介紹如何通過MQTT協議和華為雲物聯網進行通信
In the face of difficult SQL requirements, HQL is not afraid
【Camera专题】HAL层-addChannel和startChannel简析
力扣(LeetCode)183. 从不订购的客户(2022.07.02)
Recommendation letter of "listing situation" -- courage is the most valuable
Button button adaptive size of wechat applet
可視化yolov5格式數據集(labelme json文件)
Coroutinecontext in kotlin
502 (bad gateway) causes and Solutions
[fluent] fluent debugging (debug debugging window | viewing mobile phone log information | setting normal breakpoints | setting expression breakpoints)
可视化yolov5格式数据集(labelme json文件)
Anna: Beibei, can you draw?
Leetcode (540) -- a single element in an ordered array