HDOJ - 4503 湫湫系列故事——植树节
来源:互联网 发布:wap淘宝流量有用吗 编辑:程序博客网 时间:2024/04/28 07:39
这道题就是抄袭Codeforces的一道原题..http://blog.csdn.net/kk303/article/details/8043469..把三人都是朋友看成Alice..三人都不是朋友看成Bob..一个题...
Program:
#include<iostream>#include<stdio.h>#include<string.h>#include<cmath>#include<algorithm>#define ll long longusing namespace std; int n;int main(){ // freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); int T,x,i,sum,m; scanf("%d",&T); while (T--) { scanf("%d",&n); sum=n*(n-1)*(n-2)/6; m=0; for (i=1;i<=n;i++) { scanf("%d",&x); m+=x*(n-1-x); } m/=2; m=sum-m; printf("%.3lf\n",m*1.0/sum); } return 0;}
- HDOJ - 4503 湫湫系列故事——植树节
- HDOJ题目 4503 湫湫系列故事——植树节(数学)
- hdoj.4503 湫湫系列故事——植树节【排列组合】 2015/04/30
- 湫湫系列故事——植树节
- 湫湫系列故事——植树节
- HDU 4503 湫湫系列故事——植树节
- Hdu 4503 湫湫系列故事——植树节
- HDU 4503 湫湫系列故事——植树节
- hdu 4503 湫湫系列故事——植树节
- hdu 4503 湫湫系列故事——植树节 组合概率
- hdu 4503 湫湫系列故事——植树节
- hdu 4503 湫湫系列故事——植树节
- HDU 4503 湫湫系列故事——植树节
- hdu 4503 湫湫系列故事——植树节
- HDU ACM 4503 湫湫系列故事——植树节
- HDU 4503 湫湫系列故事——植树节(组合概率)
- HDU4503 湫湫系列故事——植树节
- HDU 湫湫系列故事——植树节
- 2013-4-22
- JSP中文乱码问题详解
- 原生ajax框架
- dialog 七种用法
- C++支持多态的方法
- HDOJ - 4503 湫湫系列故事——植树节
- PHP Socket Server
- IIC时序分析
- windows phone:Silverlight/WP7 MultiBinding
- centos FTP 服务器的架设和配置
- structs权限过滤器的实现
- Java数据结构 in action——————1、简介
- Ural 1029
- 初始化软件包后端失败等的解决办法