摘要: Strange Way to Express IntegersTime Limit:1000MSMemory Limit:131072KTotal Submissions:8193Accepted:2448DescriptionElina 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-08-15 22:27 芷水 阅读(245) 评论(0) 推荐(0) 编辑
摘要: Hello KikiTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1678 Accepted Submission(s): 587 Problem DescriptionOne day I was shopping in the supermarket. There was a cashier counting coins seriously when a little kid running and singing "门前大桥 阅读全文
posted @ 2013-08-15 21:46 芷水 阅读(241) 评论(0) 推荐(0) 编辑
摘要: Chinese remainder theorem againTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1299Accepted Submission(s): 481Problem Description我知道部分同学最近在看中国剩余定理,就这个定理本身,还是比较简单的:假设m1,m2,…,mk两两互素,则下面同余方程组:x≡a1(mod m1)x≡a2(mod m2)…x≡ak(mod mk)在011 #include12 #inclu 阅读全文
posted @ 2013-08-15 19:56 芷水 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 中国剩余定理,孙子高富帅。中国剩余定理到求解运用到了扩展欧几里得算法。求解模线性方程组(中国余数定理) a=B[1](mod W[1]) a=B[2](mod W[2]) ........ a=B[n](mod W[n]) 其中W,B已知,W[i]>0且W[i]与W[j]互质, 求a 设m1,m2,…mk是两两互素的正数,则对任意的整数b1,b2,…bk,同余方程组 x1 = b1 mod m1x2 = b2 mod m2 … xk = bk mod mk 其解为: X = (M1’*M1*b1)+(M2’*M2*b2)+…+(Mk’*Mk*bk) mod m; 其中 m = ... 阅读全文
posted @ 2013-08-15 19:17 芷水 阅读(787) 评论(0) 推荐(0) 编辑