当前位置:网站首页>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;
}
边栏推荐
- udp接收队列以及多次初始化的测试
- [shutter] pull the navigation bar sideways (drawer component | pageview component)
- Wechat applet development tool post net:: err_ PROXY_ CONNECTION_ Failed agent problem
- Servlet中数据传到JSP页面使用el表达式${}无法显示问题
- stm32F407-------DMA
- Return the only different value (de duplication)
- COM和CN
- [Flutter] dart: class; abstract class; factory; Class, abstract class, factory constructor
- [Yu Yue education] China Ocean University job search OMG reference
- My creation anniversary
猜你喜欢
Detailed introduction to the usage of Nacos configuration center
What are the key points often asked in the redis interview
Processing of tree structure data
[camera topic] complete analysis of camera dtsi
Ni visa fails after LabVIEW installs the third-party visa software
MySQL learning 03
What are MySQL locks and classifications
[Flutter] dart: class; abstract class; factory; Class, abstract class, factory constructor
[Flutter] dart: class;abstract class;factory;类、抽象类、工厂构造函数
[camera topic] how to save OTP data in user-defined nodes
随机推荐
iptables 4层转发
[Flutter] dart: class; abstract class; factory; Class, abstract class, factory constructor
《上市风云》荐书——唯勇气最可贵
Trial setup and use of idea GoLand development tool
Detailed introduction to the deployment and usage of the Nacos registry
各国Web3现状与未来
【CodeForces】CF1338A - Powered Addition【二进制】
Performance test | script template sorting, tool sorting and result analysis
Coroutinecontext in kotlin
Qt之QComboBox添加QCheckBox(下拉列表框插入复选框,含源码+注释)
Solution for processing overtime orders (Overtime unpaid)
In 2022, 95% of the three most common misunderstandings in software testing were recruited. Are you that 5%?
RestCloud ETL 跨库数据聚合运算
Comment communiquer avec Huawei Cloud IOT via le Protocole mqtt
Socket编程
Wechat applet Development Tool Post net:: Err Proxy Connexion Problèmes d'agent défectueux
The sandbox explains its vision for the meta universe platform
Visual yolov5 format data set (labelme JSON file)
Internal connection query and external connection
String replace space