随笔分类 -  数学

摘要:"HDU 4651 Partition" Problem : n的整数划分方案数。(n include include include include include include using namespace std; const int N = 1e5 + 8; const int mo = 阅读全文
posted @ 2017-08-02 20:38 rpSebastian 阅读(230) 评论(0) 推荐(0)
摘要:Problem Turn the pokers (HDU 4869) 题目大意 有m张牌,全为正面朝上。进行n次操作,每次可以将任意ai张反面,询问n次操作可能的状态数。 解题分析 记正面朝上为1,朝下为0。 若最后有x个1,则对答案的贡献为C(n,x)。所以只需要知道最后可能的1的个数。 假设已经 阅读全文
posted @ 2016-07-30 18:31 rpSebastian 阅读(447) 评论(0) 推荐(0)
摘要:给定方程 X^A = B (mol C) ,求 在[0,C) 中所有的解 , 并且C为质数。设 rt 为 C 的原根 , 则 X= rt^x (这里相当于求 A^x =B (mol C) 用大步小步算法即可)那么 ( rt^x ) ^ A = b (mol C) rt^Ax = b (mol C... 阅读全文
posted @ 2015-06-12 14:53 rpSebastian 阅读(260) 评论(0) 推荐(0)
摘要:首先 1+x+x^2+x^3+...+x^∞=1/(1-x)对于题目中的几种食物写出生成函数 (对于a*x^b , a表示方案数 x表示食物,b表示该种食物的个数)f(1)=1+x^2+x^4+...+x^∞=1/(1-x^2)f(2)=1+xf(3)=1+x+x^2f(4)=x+x^3+x^5+.... 阅读全文
posted @ 2015-05-25 10:26 rpSebastian 阅读(372) 评论(0) 推荐(0)
摘要:1 type xh=record 2 x,y:double; 3 end; 4 arr=array[0..1000008] of xh; 5 var n,m:longint; 6 s1,s2:ansistring; 7 a,b,g,w:a... 阅读全文
posted @ 2015-03-11 19:55 rpSebastian 阅读(206) 评论(0) 推荐(0)
摘要:var a:array[0..208,0..208] of int64; mo:int64; i,j,n,temp:longint;function guess:int64;var i,j,k,t:longint; ans:int64;begin ans:=1; for... 阅读全文
posted @ 2015-03-01 10:46 rpSebastian 阅读(213) 评论(0) 推荐(0)
摘要:按照朴素的列方程,可以列出n+1个n元2次方程。 将相邻的两个方程相减就可以得到n个n元1次方程,进行高斯消元就可以了。 阅读全文
posted @ 2015-01-14 20:40 rpSebastian 阅读(229) 评论(0) 推荐(0)