上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 36 下一页
摘要: 大傻逼题……就是求 $nk$ 个元素选出一些元素,选出的元素的个数要满足模 $k$ 余 $r$,求方案数。 想到 $\binom{n}{m}=\binom{n 1}{m 1}+\binom{n 1}{m}$,递推取模就是了…… cpp include include using namespace 阅读全文
posted @ 2018-03-14 21:52 poorpool 阅读(230) 评论(0) 推荐(0)
摘要: 可以发现, $$\displaystyle c^{c^{c^\cdots}}$$ 从下到上对应的模数是 $p,\varphi(p),\varphi(\varphi(p)),\varphi(\varphi(\varphi(p))),\ldots ,1,1$。(为什么有两个 $1$?一会儿再说) 因此当 阅读全文
posted @ 2018-03-14 19:54 poorpool 阅读(192) 评论(0) 推荐(0)
摘要: 我们枚举每一个时间点,使得所有科目的时间都小于等于这个时间点,计算安排老师的代价和学生们的不满意度更新答案。 但是枚举太慢了,可以发现,时间点越早,学生们不满意度越小,安排老师的代价越高。即安排老师的代价、学生们的不满意度和时间点的关系一个是负相关一个是正相关的。 因此,安排老师的代价、学生们的不满 阅读全文
posted @ 2018-03-14 15:45 poorpool 阅读(164) 评论(0) 推荐(0)
摘要: ```cpp include include include using namespace std; int n, l, k; double dp[205][205][205], ans;//pass [] gates, win [] games, with size[] struct Node{ 阅读全文
posted @ 2018-03-13 19:33 poorpool 阅读(98) 评论(0) 推荐(0)
摘要: 容斥搞出 gcd 不是 $1$ 的四元组个数。 "参考" cpp include include include using namespace std; typedef long long ll; int n, cnt[10005], num[10005], uu, fac[35], din; l 阅读全文
posted @ 2018-03-13 18:54 poorpool 阅读(97) 评论(0) 推荐(0)
摘要: nim和线性基 include include include using namespace std; typedef long long ll; int n, uu, ji[35], a[105]; ll ans; int main(){ cin n; for(int i=1; i=1; i ) 阅读全文
posted @ 2018-03-13 11:30 poorpool 阅读(111) 评论(0) 推荐(0)
摘要: 模意义下整数高斯消元 cpp include include include using namespace std; int n, m, k, uu, a[305][305]; char ss[15]; int getDay(){ if(ss[0]=='M') return 1; if(ss[0] 阅读全文
posted @ 2018-03-13 10:49 poorpool 阅读(161) 评论(0) 推荐(0)
摘要: 一列一列地推就可以了 cpp include include using namespace std; typedef long long ll; int n, m; const int mod=10000007; struct Matrix{ int num[15][15]; Matrix ope 阅读全文
posted @ 2018-03-12 20:52 poorpool 阅读(176) 评论(0) 推荐(0)
摘要: 分治即可 当然也可以把矩阵看成元素用矩阵快速幂做 cpp include include using namespace std; int n, k, m; struct Matrix{ int num[35][35]; Matrix operator (const Matrix &x)const{ 阅读全文
posted @ 2018-03-12 19:21 poorpool 阅读(94) 评论(0) 推荐(0)
摘要: 欲求 $\sum_{i=1}^n (i,n)$。 显然 $(i,n) \mid n$。记 $d=(i,n)$,枚举 $d$,有多少个 $i \in [1,n]$ 使得 $(i,n)=d$ 呢?换句话说有多少个 $i \in [1,\lfloor n/d \rfloor]$ 使得 $(i,\lfloo 阅读全文
posted @ 2018-03-12 16:48 poorpool 阅读(90) 评论(0) 推荐(0)
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 36 下一页