zoukankan      html  css  js  c++  java
  • uva11186

    题目连接:UVA - 11186

    意外发现这道题,最近发现贡献度这个东西很常见啊。。。

    可是我什么都不会。。。

    先存一下http://www.cnblogs.com/zhuanzhuruyi/p/6160694.html

     1 #include<set>
     2 #include<map>
     3 #include<queue>
     4 #include<stack>
     5 #include<cmath>
     6 #include<vector>
     7 #include<string>
     8 #include<cstdio>
     9 #include<cstring>
    10 #include<iomanip>
    11 #include<stdlib.h>
    12 #include<iostream>
    13 #include<algorithm>
    14 using namespace std;
    15 #define eps 1E-8
    16 /*注意可能会有输出-0.000*/
    17 #define Sgn(x) (x<-eps? -1 :x<eps? 0:1)//x为两个浮点数差的比较,注意返回整型
    18 #define Cvs(x) (x > 0.0 ? x+eps : x-eps)//浮点数转化
    19 #define zero(x) (((x)>0?(x):-(x))<eps)//判断是否等于0
    20 #define mul(a,b) (a<<b)
    21 #define dir(a,b) (a>>b)
    22 typedef long long ll;
    23 typedef unsigned long long ull;
    24 const int Inf=1<<28;
    25 const ll INF=1ll<<60;
    26 const double Pi=acos(-1.0);
    27 const int Mod=1e9+7;
    28 const int Max=10010;
    29 double g[Max];
    30 int main()
    31 {
    32 int n,r;
    33 while(~scanf("%d %d",&n,&r))
    34 {
    35     if(!n&&!r)
    36         break;
    37     for(int i=0;i<n;++i)
    38     {
    39         scanf("%lf",&g[i]);
    40         g[i]=g[i]/180*Pi;
    41     }
    42     sort(g,g+n);
    43     double ans=0;
    44     for(int i=0;i<n;++i)
    45     {
    46         for(int j=i+1;j<n;++j)
    47         {
    48             ans+=(n+2*i-2*j)*1.0*sin(g[j]-g[i]);
    49         }
    50     }
    51     ans=ans*r*r*0.5;
    52     printf("%.0f
    ",ans);
    53 }
    54 return 0;
    55 }
  • 相关阅读:
    ReactJs入门
    Studio-Class Diagram
    Visual Studio-Sequence Diagram
    架构、职责、数据一致性
    Microsoft Build 2015
    Net下无敌的ORM
    SpringMVC1
    插件式Web框架
    ASP.NET的CMS
    Android Drawable绘图学习笔记(转)
  • 原文地址:https://www.cnblogs.com/yijiull/p/6804286.html
Copyright © 2011-2022 走看看