摘要: #include #include #include #include #include #include #include #include #include #include using namespace std; #define rep(i,a,n) for (int i=a;i=a;i--) #define pb push_back #define mp make_p... 阅读全文
posted @ 2019-03-17 23:25 shuai_hui 阅读(318) 评论(0) 推荐(0)
摘要: 今天zyb参加一场面试,面试官听说zyb是ACMer之后立马抛出了一道算法题给zyb:有一个序列,是1到n的一种排列,排列的顺序是字典序小的在前,那么第k个数字是什么?例如n=15,k=7, 排列顺序为1, 10, 11, 12, 13, 14, 15, 2, 3, 4, 5, 6, 7, 8, 9 阅读全文
posted @ 2019-03-17 16:36 shuai_hui 阅读(1120) 评论(0) 推荐(0)
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=6464 不理解先看博客:https://blog.csdn.net/g21glf/article/details/82986968 已知一开始有一个空序列,接下来有Q次操作,每次操作给出type、first和sec 阅读全文
posted @ 2019-03-17 12:42 shuai_hui 阅读(298) 评论(0) 推荐(0)
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=6470 题意:f[n] = f[n-1] + f[n-2]*2 + n^3; f[1] =1 ; f[2] = 2 ; 求f[n; 分析:一眼相望可知为矩阵快速幂 , 在此在此加深了矩阵快速幂的用法; 下面是推导过 阅读全文
posted @ 2019-03-17 10:44 shuai_hui 阅读(844) 评论(3) 推荐(0)
摘要: //O(1)快速乘 inline LL quick_mul(LL x,LL y,LL MOD){ x=x%MOD,y=y%MOD; return ((x*y-(LL)(((long double)x*y+0.5)/MOD)*MOD)%MOD+MOD)%MOD; } //O(log)快速乘 inlin 阅读全文
posted @ 2019-03-17 09:30 shuai_hui 阅读(339) 评论(0) 推荐(0)