当前位置:网站首页>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;
}
边栏推荐
- 【Camera专题】HAL层-addChannel和startChannel简析
- Return the only different value (de duplication)
- easyPOI
- String replace space
- Distributed transaction solution
- 微信小程序开发工具 POST net::ERR_PROXY_CONNECTION_FAILED 代理问题
- stm32F407-------DMA
- 机器学习笔记(持续更新中。。。)
- Ni visa fails after LabVIEW installs the third-party visa software
- 详细些介绍如何通过MQTT协议和华为云物联网进行通信
猜你喜欢
![[shutter] top navigation bar implementation (scaffold | defaulttabcontroller | tabbar | tab | tabbarview)](/img/f1/b17631639cb4f0f58007b86476bcc2.gif)
[shutter] top navigation bar implementation (scaffold | defaulttabcontroller | tabbar | tab | tabbarview)

Y54. Chapter III kubernetes from introduction to mastery -- ingress (27)

Everything file search tool

Comment communiquer avec Huawei Cloud IOT via le Protocole mqtt

返回一个树形结构数据

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

Wechat applet Development Tool Post net:: Err Proxy Connexion Problèmes d'agent défectueux

Bottleneck period must see: how can testers who have worked for 3-5 years avoid detours and break through smoothly

The testing process that software testers should know

MySQL learning 03
随机推荐
Technology sharing | Frida's powerful ability to realize hook functions
[shutter] pull the navigation bar sideways (drawer component | pageview component)
深度学习笔记(持续更新中。。。)
苏世民:25条工作和生活原则
String replace space
Wechat applet development tool post net:: err_ PROXY_ CONNECTION_ Failed agent problem
Su Shimin: 25 principles of work and life
疫情当头,作为Leader如何进行团队的管理?| 社区征文
stm32F407-------ADC
Kotlin middle process understanding and Practice (I)
Return the only different value (de duplication)
Comment communiquer avec Huawei Cloud IOT via le Protocole mqtt
Bottleneck period must see: how can testers who have worked for 3-5 years avoid detours and break through smoothly
[leetcode] 797 and 1189 (basis of graph theory)
How do it students find short-term internships? Which is better, short-term internship or long-term internship?
Huakaiyun (Zhiyin) | virtual host: what is a virtual host
Answers to ten questions about automated testing software testers must see
RestCloud ETL 跨库数据聚合运算
2022 spring "golden three silver four" job hopping prerequisites: Software Test interview questions (with answers)
浏览器是如何对页面进行渲染的呢?