随笔分类 -  数学-mod意义下

摘要:http://codeforces.com/contest/490/problem/C表示我考场上犯逗。。这个拆成霍纳边乘边mod即可。。为毛我考场胡思乱想?#include #include #include #include #include #include #include using na... 阅读全文
posted @ 2014-11-24 06:25 iwtwiioi 阅读(337) 评论(0) 推荐(0)
摘要:https://vijos.org/p/1164好赞orz。对于求一组线性同余方程x=a[i](mod m[i])这里任意两个m[i]和m[j]都互质那么可以用中国剩余定理来做。对中国剩余定理的理解:(转自matrix67神犇的blog:http://www.matrix67.com/blog/ar... 阅读全文
posted @ 2014-10-06 16:06 iwtwiioi 阅读(623) 评论(0) 推荐(0)
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=2982少加了特判n#include #include #include #include #include #include using namespace std;#define rep(i, n) ... 阅读全文
posted @ 2014-10-03 15:52 iwtwiioi 阅读(726) 评论(0) 推荐(0)
摘要:https://vijos.org/p/1781学习了下拓欧。。求exgcd时,因为a*x1+b*y1=a*x2+b*y2=b*x2+(a-b*[a/b])*y2然后移项得a*x1+b*y1=b*x2+a*y2-(b*[a/b])*y2a*(x1-y2)+b*y1-b*x2+(b*[a/b]*y2)... 阅读全文
posted @ 2014-10-03 12:57 iwtwiioi 阅读(362) 评论(0) 推荐(0)
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=3398以下牡牛为a,牝牛为b。学完排列计数后试着来写这题,“至少”一词可以给我们提示,我们可以枚举a为x头(x>1),然后算出对应的排列累计起来。对于x头a,首先我们先缩掉必要的k头牛(x-1)*k,然... 阅读全文
posted @ 2014-09-29 18:53 iwtwiioi 阅读(818) 评论(0) 推荐(0)