博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
HLG 1253 Count the Number of Cycles【ldpc环】
阅读量:6137 次
发布时间:2019-06-21

本文共 1861 字,大约阅读时间需要 6 分钟。

Description
 In information theory, a low-density parity-check (LDPC) code is a linear error correcting code, a method of transmitting a message over a noisy transmission channel, and is constructed using a sparse bipartite graph. LDPC codes are capacity-approaching codes, which means that practical constructions exist that allow the noise threshold to be set very close (or even arbitrarily close on the BEC) to the theoretical maximum (the Shannon limit) for a symmetric memory-less channel.
LDPC codes are defined by a sparse parity-check matrix. This parity-check matrix is often randomly generated and the elements in it are 0 or 1. If we want use LDPC codes, we should make the parity-check matrix have no cycles. When four vertices of the rectangle in the matrix are 1, we say that the matrix has one cycle. Now we want to know how many cycles are in the matrix.
For a given matrix, you are to count the number of cycles in the matrix.
Input
 There are several test cases, each test case starts with a line containing two positive integers M and N. M and N is the size of the matrix (1 <= M <= 100, 1 <= N <= 100). Next follow a matrix which contains only number 0 and 1. The input will finish with the end of file.
Output
 For each the case, your program will output the number of cycles in the given matrix on separate line.
Sample Input
1 31 1 12 31 0 10 1 13 31 0 10 1 11 1 1
Sample Output
002
方法:暴力枚举

code:

View Code
#include
int a[101][101]; int main() { int n,m,tot,s,i,j,k; while(scanf("%d%d",&n,&m)!=EOF) { for(i=0;i
=2) tot+=s*(s-1)/2; s=0; } printf("%d\n",tot); } return 0; }

 

转载于:https://www.cnblogs.com/dream-wind/archive/2012/03/16/2400028.html

你可能感兴趣的文章
《跟阿铭学Linux》第8章 文档的压缩与打包:课后习题与答案
查看>>
RAC表决磁盘管理和维护
查看>>
HDU 3622 Bomb Game(二分+2-SAT)
查看>>
Apache通过mod_php5支持PHP
查看>>
发布一个TCP 吞吐性能测试小工具
查看>>
java学习:jdbc连接示例
查看>>
PHP执行批量mysql语句
查看>>
Extjs4.1.x 框架搭建 采用Application动态按需加载MVC各模块
查看>>
Silverlight 如何手动打包xap
查看>>
建筑电气暖通给排水协作流程
查看>>
JavaScript面向对象编程深入分析(2)
查看>>
linux 编码转换
查看>>
POJ-2287 Tian Ji -- The Horse Racing 贪心规则在动态规划中的应用 Or 纯贪心
查看>>
Windows8/Silverlight/WPF/WP7/HTML5周学习导读(1月7日-1月14日)
查看>>
关于C#导出 文本文件
查看>>
使用native 查询时,对特殊字符的处理。
查看>>
maclean liu的oracle学习经历--长篇连载
查看>>
ECSHOP调用指定分类的文章列表
查看>>
分享:动态库的链接和链接选项-L,-rpath-link,-rpath
查看>>
阿里云企业邮箱 在Foxmail 7.0上POP3/IMAP协议设置方法
查看>>