【鏈接】
bzoj1800
【解題報告】
其實只需要算出兩點連線爲圓的直徑的方案數。
答案就是
#include<cstdio>
using namespace std;
const int maxn=25;
int n,ans,sum,a[maxn];
int main()
{
freopen("1800.in","r",stdin);
freopen("1800.out","w",stdout);
scanf("%d",&n); sum=ans=0;
for (int i=1; i<=n; i++) scanf("%d",&a[i]),sum+=a[i];
for (int i=1; i<n; i++)
{
int now=a[i];
for (int j=i+1; j<=n; j++)
{
if (sum-now==now) {ans++; break;}
if (sum-now<now) break;
now+=a[j];
}
}
printf("%d",ans*(ans-1)/2);
return 0;
}