摘要:
1001CRB and Apple1002CRB and Candies1003CRB and Farm1004CRB and Graph1005CRB and His Birthday加一维0和1表示有没有拿过这种糖。然后完全背包滚动数组过去就可以了。然而实际上不用加这一维。直接先0-1再完全就可... 阅读全文
摘要:
1001Expression式子不好推啊。见官方题解。式子知道就方便了。处理好组合数和阶乘。按区间长度从小到大递推完就好。 1 # include 2 # include 3 # include 4 using namespace std; 5 # define maxn 105 6 type... 阅读全文
摘要:
8.16补BC。HDU 5391Zball in Tina Town求(n-1)!%n。首先合数的话前面必然有它的因子。所以是0。质数我打表才发现是n-1。然而有一个著名的威尔逊定理(渣根本没听过。坑在于n=4时是2。没判就死了QAQ。 1 # include 2 # include 3 usi... 阅读全文
摘要:
1001Travel with candy1002The sum of gcd学了莫队补的。基本还是别人的方法。先预处理出每个点左右的gcd区间。最多log(a[i])个。然后套莫队转移。 1 # include 2 # include 3 # include 4 # include ... 阅读全文
摘要:
1001Game On the Tree1002Tree Maker1003Hotaru's problemManacher处理好p数组。暴力举一下公共串即可。 1 # include 2 # include 3 # include 4 using namespace std; 5 const... 阅读全文