摘要: 题意:一个递推式第n项%b是多少。 递推式: 构造矩阵: #include<cstdio> #include<cstring> #include<cmath> #include<vector> #include<algorithm> using namespace std; long long MO 阅读全文
posted @ 2016-03-05 16:54 Fighting_Heart 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 矩阵快速幂。 首先得到这个式子: 依据这个,就可以构造矩阵。 #include<cstdio> #include<cstring> #include<cmath> #include<vector> #include<algorithm> using namespace std; long long 阅读全文
posted @ 2016-03-05 15:04 Fighting_Heart 阅读(248) 评论(0) 推荐(0) 编辑
摘要: 排序+构造+预处理 #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> using namespace std; const int maxn = 200000 + 10; int n, m; int a[ma 阅读全文
posted @ 2016-03-05 10:41 Fighting_Heart 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 对于每一个格子,看是行最后画还是列最后画。预处理一下就可以了。 #include<stdio.h> #include<string.h> int n,m,k; int op[100000+10]; int id[100000+10]; int info[100000+10]; int high[20 阅读全文
posted @ 2016-03-05 10:39 Fighting_Heart 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 所有数字都或一下就好了。肯定是最大的。 #include<stdio.h> #include<string.h> int n; long long a[1000+10]; long long b[1000+10]; int main() { scanf("%d",&n); for(int i=1;i 阅读全文
posted @ 2016-03-05 10:37 Fighting_Heart 阅读(157) 评论(0) 推荐(0) 编辑