当前位置:网站首页>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;
}
边栏推荐
- PyTorch 卷积网络正则化 DropBlock
- [camera special topic] Hal layer - brief analysis of addchannel and startchannel
- 我的创作纪念日
- Detailed introduction to the usage of Nacos configuration center
- MySQL learning 03
- Wechat applet development tool post net:: err_ PROXY_ CONNECTION_ Failed agent problem
- [fluent] fluent debugging (debug debugging window | viewing mobile phone log information | setting normal breakpoints | setting expression breakpoints)
- Swift development learning
- 力扣(LeetCode)183. 从不订购的客户(2022.07.02)
- 【Camera专题】HAL层-addChannel和startChannel简析
猜你喜欢
Query product cases - page rendering data
Visualisation de l'ensemble de données au format yolov5 (fichier labelme json)
可視化yolov5格式數據集(labelme json文件)
Performance test | script template sorting, tool sorting and result analysis
技术大佬准备就绪,话题C位由你决定
[shutter] bottom navigation bar implementation (bottomnavigationbar bottom navigation bar | bottomnavigationbaritem navigation bar entry | pageview)
How can retail enterprises open the second growth curve under the full link digital transformation
Machine learning notes (constantly updating...)
Asian Games countdown! AI target detection helps host the Asian Games!
stm32F407-------ADC
随机推荐
Processing of tree structure data
Prohibited package name
Distributed transaction solution
Answers to ten questions about automated testing software testers must see
Kotlin middle process understanding and Practice (I)
Socket programming
Network security - password cracking
Unrecognized SSL message, plaintext connection?
[shutter] shutter debugging (debugging control related functions | breakpoint management | code operation control)
Technology sharing | Frida's powerful ability to realize hook functions
Solution for processing overtime orders (Overtime unpaid)
Custom components, using NPM packages, global data sharing, subcontracting
Job object of collaboration in kotlin
返回一个树形结构数据
Use go language to realize try{}catch{}finally
[fluent] hero animation (hero animation use process | create hero animation core components | create source page | create destination page | page Jump)
Leetcode 183 Customers who never order (2022.07.02)
[Yu Yue education] Jiujiang University material analysis and testing technology reference
Startup mode and scope builder of collaboration in kotlin
查询商品案例-页面渲染数据