生成函数
青烟绕指柔!
我不怕千万人阻挡,只怕自己投降。
展开
-
Exclusive OR
题目链接:Exclusive OR 比赛的时候只想到了对值域做值域次,显然是过不了的。 但是我们可以发现:当n大于19时res[i]=res[i-2],所以只用做19次即可。 AC代码: #pragma GCC optimize("-Ofast","-funroll-all-loops") #include<bits/stdc++.h> #define int long long using namespace std; const int mod=1e9+7,N=1e6+10,inv2=5原创 2020-07-15 10:39:52 · 131 阅读 · 0 评论 -
BZOJ-4589 FWT+生成函数+NIM博弈+快速幂
4589: Hard Nim Time Limit: 10 Sec Memory Limit: 128 MB Submit: 2057 Solved: 1099 [Submit][Status][Discuss] Description Claris和NanoApe在玩石子游戏,他们有n堆石子,规则如下: Claris和NanoApe两个人轮流拿石子,Claris先拿。 每次只能从一堆中取若...原创 2020-01-24 17:22:52 · 3093 阅读 · 0 评论 -
A+B Problem 生成函数+FFT
题目链接:A+B Problem Given N integers in the range [−50000,50000], how many ways are there to pick three integers ai, aj, ak, such that i, j, k are pairwise distinct and ai+aj=ak? Two ways are different i...原创 2020-01-17 14:10:12 · 308 阅读 · 0 评论 -
HDU - 4609 生成函数+FFT
3-idiots Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 10462 Accepted Submission(s): 3554 Problem Description King OMeGa catched three me...原创 2020-01-17 11:09:34 · 1614 阅读 · 1 评论 -
hdu 1521 排列组合
排列组合 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 5948 Accepted Submission(s): 2614 Problem Description 有n种物品,并且知道每种物品的数量。要求从中选出m件物品的排列数。...原创 2019-12-24 19:42:03 · 179 阅读 · 0 评论