08 2018 档案
摘要:由于行只有12,所以对行进行状态压缩 0表示这行没有被扎过,也不存在没有爆的气球 1表示这行没有被扎过,存在没有爆的气球 2表示这行被扎过 枚举每一列 对于第i行第j列的气球 2种转移 扎和不扎 扎< 0,1 不扎< 0,1
阅读全文
摘要:从0-(n-1)选m个数和为k的方案数 设f[i]为有i个位置大于n的方案 f[0]=all-(f[1]∪f[2]∪f[3]。。) =all-f[1]-f[2]..+(f[1]∩f[2])。。。 奇减偶加
阅读全文
摘要:容斥+gcd+欧拉函数 求出1-n 和 1-m所有gcd(i,j)==x对数 x的范围1-min(n,m) 分解x的质因子 (1-1/p)... q[x]=(1-1/p1)*(1-1/p2)/... p是x的质因子 ans=sigma(q[x]*gcd(i,j)==x的对数) 1<=x<=min(n
阅读全文
摘要:#include #include #include using namespace std; typedef long long ll; const int mod=1e9+7; int a,b,c,d,p,n; struct node { int m[3][3]; node() { memset(m, 0, sizeof(node)); } ...
阅读全文
摘要:int Pow(int x,int y){ int ans=1; for (;y;y>>=1,x=1LL*x*x%mod) if (y&1) ans=1LL*ans*x%mod; return ans; } void FWT(int a[],int n,int flag){ for (int d=1;d0; }
阅读全文
摘要:Problem B. Harvest of Apples Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 1006 Accepted Subm
阅读全文

浙公网安备 33010602011771号