数论--排列组合数学
长沙大学ccsu_deer
这个作者很懒,什么都没留下…
展开
-
牛客挑战赛33(A,B(组合数))
这场好难啊,学到了B题组合数的高级预处理法,所以特地写篇博客 题目链接 A 题打个表就知道当a==b&&b==c&&a==c就是输出NO,其他输出YES #include<bits/stdc++.h> using namespace std; const int N=1e2+10; string a,b,c; bool check(string ...原创 2019-10-23 23:41:58 · 408 阅读 · 0 评论 -
D. Anton and School - 2(范德蒙恒等式)
time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output As you probably know, Anton goes to school. One of the school subjects that Ant...原创 2019-07-04 10:19:37 · 521 阅读 · 0 评论 -
D. Almost Identity Permutations(错排公式)
【题意】 给n、k,至少n-k个位置权值p[i]==i 【题解】 设有i个位置权值p[i]==i,由于k最大只有4,枚举i即可。剩下的位置错排一下。 C(n,i)*d[n-i] 【代码】 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N=1e3+10; ll d[N...原创 2019-07-21 10:08:09 · 439 阅读 · 0 评论