上一页 1 ··· 7 8 9 10 11

2019年8月20日

逆元详解

摘要: START 为什么需要求逆元?显然对于加减乘运算都会满足: (a+b)%p=(a%p+b%p)%p (a-b)%p=(a%p-b%p)%p (a*b)%p=((a%p)*(b%p))%p但是对于除法而言(a/b)%p!=(a%p)/(b%p),这个可以通过举例验证一下或者可以通过(b%p)可以为0但 阅读全文

posted @ 2019-08-20 20:24 Caution_X 阅读(463) 评论(2) 推荐(0) 编辑

2019年8月10日

二维数组前缀和

摘要: 给定一个矩阵,求子矩阵元素之和。 可以暴力遍历,但是一般题目时间上不会允许你这么做。 通过预处理二维数组使得需要子矩阵之和时以O(1)直接求。 输入: for(int i=1;i<=n;i++) for(int j=1;j<=m;j++) cin >>map[i][j]; 记dp[i][j]表示左上 阅读全文

posted @ 2019-08-10 22:58 Caution_X 阅读(1045) 评论(0) 推荐(0) 编辑

2019年5月16日

HDU-1358 Period

摘要: 参考自:https://blog.csdn.net/qq_41061455/article/details/80370359 HDU-1358 Period For each prefix of a given string S with N characters (each character h 阅读全文

posted @ 2019-05-16 00:21 Caution_X 阅读(100) 评论(0) 推荐(0) 编辑

2019年5月10日

CodeForces 938E Max History 题解

摘要: 参考自:https://blog.csdn.net/dreaming__ldx/article/details/84976834 https://blog.csdn.net/acterminate/article/details/79339494 题意: 给你一个数组,将数组里的所有元素进行全排列, 阅读全文

posted @ 2019-05-10 00:28 Caution_X 阅读(268) 评论(1) 推荐(0) 编辑

上一页 1 ··· 7 8 9 10 11

导航