/*看英文和图我头都大了,不过很简单的。*/
#include<string.h>
#include<stdio.h>
int s[][],q[],w[];
int main(int argc, char* argv[])
{ int t,n,m,i,j;
int count;
scanf("%d",&t);
while(t--)
{
memset(s,,sizeof(s));
count=;
scanf("%d%d",&n,&m);
for(i=;i<m;i++)
scanf("%d",&q[i]);
for(j=;j<m;j++)
scanf("%d",&w[j]);
for(i=;i<m;i++)
{
if(!s[q[i]][w[i]])/*防止重复访问*/
{
count++;
s[q[i]][w[i]]=;
s[w[i]][q[i]]=;
}
}
printf("%.3f\n",1.0*count/n); } return ;
}

zoj 3708 Density of Power Network的更多相关文章

  1. [ACM_图论] ZOJ 3708 [Density of Power Network 线路密度,a->b=b->a去重]

    The vast power system is the most complicated man-made system and the greatest engineering innovatio ...

  2. ZOJ Problem Set - 3708 Density of Power Network

    http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3708 #include <stdio.h> #include ...

  3. Density of Power Network(ZOJ 3708)

    Problem The vast power system is the most complicated man-made system and the greatest engineering i ...

  4. ZOJ3708:Density of Power Network

    The vast power system is the most complicated man-made system and the greatest engineering innovatio ...

  5. POJ 1459 Power Network / HIT 1228 Power Network / UVAlive 2760 Power Network / ZOJ 1734 Power Network / FZU 1161 (网络流,最大流)

    POJ 1459 Power Network / HIT 1228 Power Network / UVAlive 2760 Power Network / ZOJ 1734 Power Networ ...

  6. poj1459 Power Network (多源多汇最大流)

    Description A power network consists of nodes (power stations, consumers and dispatchers) connected ...

  7. Power Network(网络流最大流 & dinic算法 + 优化)

    Power Network Time Limit: 2000MS   Memory Limit: 32768K Total Submissions: 24019   Accepted: 12540 D ...

  8. Power Network 分类: POJ 2015-07-29 13:55 3人阅读 评论(0) 收藏

    Power Network Time Limit: 2000MS Memory Limit: 32768K Total Submissions: 24867 Accepted: 12958 Descr ...

  9. POJ1459 Power Network(网络最大流)

                                         Power Network Time Limit: 2000MS   Memory Limit: 32768K Total S ...

随机推荐

  1. MySQLdb的安装

    第一步:下载安装介质 https://pypi.python.org/pypi/MySQL-python 注意虽然模块名叫MySQLdb但是MySQL-python指的就是MySQLdb 第二步:安装 ...

  2. hibernate详解

    Hibernate原理与应用 主要内容 1.引入 2.安装配置 3.基本概念和CURD 4.HQL和Criteria 5.关联映射 6.继承映射 7.集合映射 8.懒加载 9.缓存 10.事务 11. ...

  3. Ubuntu adb devices 出现??? no permissions 的解决方法

    在ubuntu 12.10下运行adb devices出现: List of devices attached ???????????? no permissions 1.用命令:   lsusb 以 ...

  4. Android Gson深入分析

    眼下解析json有三种工具:org.json(Java经常使用的解析),fastjson(阿里巴巴project师开发的).Gson(Google官网出的).解析速度最快的是Gson,下载地址:htt ...

  5. Myeclipse2014 SVN安装方法以及项目上传到svn服务器

    1. 打开 Myeclipse 工具栏下的Help下的Install from Site 2.打开后弹出窗口, 并点击Add标签,如下图: 3.现在是最重要的一步,填写相关信息. 在对话框Name输入 ...

  6. 7. Reverse Integer

    1. 问题描述 Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321 cl ...

  7. grivid中切换按钮,两个按钮交替

    给grivdView不要设值 button的url和 commandName 在rowDatabound中操作变换 protected void GVData_RowDataBound(object ...

  8. SQL学习之汇总数据之聚集函数

    一. 1.我们经常需要汇总数据而不用把他们实际检索出来,为此SQL提供了专门的函数,以便于分析数据和报表生成,这些函数的功能有: (1)确定表中行数(或者满足单个条件或多个条件或包含某个特定值的行数) ...

  9. param

    页面之间值传递用param作为参数,提高网站安全性

  10. MATLAB中imshow()和image()

    MATLAB中imshow()和image(): IMSHOW Display image in Handle Graphics figure. IMSHOW(I) displays the gray ...