在MOD的情况下, (a*b/c ) %MOD 不能直接 / c 来求,需要找到一个数 inv 使得 inv * c % MOD = 1 。 这样 (a*b / c) % MOD = (a * b * inv) % MOD;性质: 逆元是积性函数 存在 a*b = c ,那么 inv[c] = i... Read More
posted @ 2014-09-15 19:16 ZYF-ZYF Views(1154) Comments(0) Diggs(0) Edit
1628: [Usaco2007 Demo]City skylineTime Limit: 5 SecMemory Limit: 64 MBSubmit: 256Solved: 210[Submit][Status]DescriptionThe best part of the day for Fa... Read More
posted @ 2014-09-15 19:04 ZYF-ZYF Views(248) Comments(1) Diggs(0) Edit
2440: [中山市选2011]完全平方数Time Limit: 10 SecMemory Limit: 128 MBSubmit: 883Solved: 425[Submit][Status]Description小 X 自幼就很喜欢数。但奇怪的是,他十分讨厌完全平方数。他觉得这些数看起来很令人难... Read More
posted @ 2014-09-15 18:54 ZYF-ZYF Views(332) Comments(3) Diggs(0) Edit
大神们都在刷usaco,我也来水一水1606: [Usaco2008 Dec]Hay For Sale 购买干草 裸背包1607: [Usaco2008 Dec]Patting Heads 轻拍牛头 神转化,筛法1609: [Usaco2008 Feb]Eating Together麻烦的聚餐 LI... Read More
posted @ 2014-09-15 12:01 ZYF-ZYF Views(571) Comments(0) Diggs(0) Edit
1816: [Cqoi2010]扑克牌Time Limit: 10 SecMemory Limit: 64 MBSubmit: 1170Solved: 430[Submit][Status]Description你有n种牌,第i种牌的数目为ci。另外有一种特殊的牌:joker,它的数目是m。你可以用... Read More
posted @ 2014-09-15 11:00 ZYF-ZYF Views(232) Comments(0) Diggs(0) Edit