2013年7月24日

poj 2891 模线性方程组求解

摘要: Strange Way to Express IntegersTime Limit:1000MSMemory Limit:131072KTotal Submissions:8005Accepted:2378DescriptionElina is reading a book written by Rujia Liu, which introduces a strange way to express non-negative integers. The way is described as following:Choosekdifferent positive integersa1,a2,… 阅读全文

posted @ 2013-07-24 22:37 雄.. 阅读(224) 评论(0) 推荐(0)

数论欧几里德定理的运用

摘要: 欧几里得/扩展欧几里得/模线性方程组(中国剩余定理以及mod不互质的情况)欧几里得/扩展欧几里得/模线性方程组(中国剩余定理 以及mod不互质的情况)/***********欧几里得算法**************/辗转相除法求最大公约数。GCD(a,b)=GCD(b,a mod b)稍微证明一下:(参考:算法导论)证明的思路是大致是这样的:证明 GCD(a,b) | GCD(b,a mod b) 并且 GCD(b,a mod b) | GCD(a,b)先证GCD(a,b) | GCD(b,a mod b):设 d=GCD(a,b),则d|a 并且 d|b那么 a=r+kb (k为整数)也就是 阅读全文

posted @ 2013-07-24 21:24 雄.. 阅读(557) 评论(0) 推荐(0)

uva 11806 容斥原理+dfs

摘要: In most professional sporting events, cheerleaders play a major role in entertaining the spectators. Their roles are substantial during breaks and prior to start of play. The world cup soccer is no exception. Usually the cheerleaders form a group and perform at the centre of the field. In addition t 阅读全文

posted @ 2013-07-24 09:13 雄.. 阅读(222) 评论(0) 推荐(0)

导航