07 2018 档案

摘要:1 /* 2 题意:求a(n)=a(n-1)+a(n-2)+a(n-3)+......a(n-k)+... k 8 using namespace std; 9 10 typedef long long LL; 11 const int MAXN = 100005; 12 const LL MOD7 = 1e9+7; 13 const LL MOD9 = 1... 阅读全文
posted @ 2018-07-31 21:24 LeeSongt 阅读(199) 评论(0) 推荐(0)
摘要:1 /* 2 题意:大数乘法NTT 3 题解:FNT 4 时间:2018.07.30 5 */ 6 7 #include 8 using namespace std; 9 10 typedef long long LL; 11 const int MAXN = 100005; 12 const LL MOD7 = 1e9+7; 13 ... 阅读全文
posted @ 2018-07-30 11:21 LeeSongt 阅读(240) 评论(0) 推荐(0)
摘要:1 /* 2 题意:求一个数x的原根 3 题解:x=p1^e1 * p2^e2 * p3^e3 * pm^em 4 依次判断 a^((x-1)/pi) == 1 mod x 是否等于1,如果都不等于1那么a是原根。 5 时间:2018.07.26 6 */ 7 8 #include 9 using namespace std; ... 阅读全文
posted @ 2018-07-26 21:19 LeeSongt 阅读(689) 评论(0) 推荐(0)
摘要:1 /* 2 题意:查询区间第K大 3 题解:主席树 4 时间: 5 */ 6 7 #include 8 using namespace std; 9 10 typedef long long LL; 11 const int MAXN = 100005; 12 const LL MOD7 = 1e9+7; 13 14 struct TreeNode 15 ... 阅读全文
posted @ 2018-07-21 21:06 LeeSongt 阅读(227) 评论(0) 推荐(0)
摘要:题目链接: https://www.nowcoder.com/acm/contest/133/B 阅读全文
posted @ 2018-07-21 11:53 LeeSongt 阅读(154) 评论(0) 推荐(0)
摘要:1 /* 2 题意: 3 题解:cdq分治 4 时间: 5 */ 6 7 #include 8 using namespace std; 9 10 typedef long long LL; 11 const int MAXN = 100005; 12 const LL MOD7 = 1e9+7; 13 14 inline int... 阅读全文
posted @ 2018-07-20 15:47 LeeSongt 阅读(159) 评论(0) 推荐(0)
摘要:1 /* 2 题意:n,m 8 using namespace std; 9 10 typedef long long LL; 11 const int MAXN = 100005; 12 const LL MOD7 = 1e9+7; 13 14 struct Node 15 { 16 int l,r; 17 int idx; 18 }Q... 阅读全文
posted @ 2018-07-20 11:08 LeeSongt 阅读(181) 评论(0) 推荐(0)
摘要:1 /* 2 题意: 3 思路: 4 时间: 5 */ 6 #include 7 using namespace std; 8 9 typedef long long LL; 10 const int MAXN=100005; 11 const LL MOD7 = 1e9+7; 12 13 struct Query 14 { 15 int l,r; 1... 阅读全文
posted @ 2018-07-19 22:13 LeeSongt 阅读(103) 评论(0) 推荐(0)
摘要:1 /* 2 题意:五维偏序,n 9 using namespace std; 10 11 typedef long long LL; 12 const int MAXN = 50005; 13 const LL MOD7 = 1e9+7; 14 15 inline int read() 16 { 17 int x=0,f=1;char c=getch... 阅读全文
posted @ 2018-07-19 20:08 LeeSongt 阅读(187) 评论(0) 推荐(0)
摘要:1 /* 2 题意:BZOJ2957 n,m=M,那么答案在右区间,否则,我们答案受到左区间的影响,可以用总长度-左区间的长度+左区间的询问长度 5 更新操作: 维护区间的最大值, 6 区间的最长的长度的更新: 左区间的长度+ 右区间大于左区间最大值的长度 7 时间:2018.07.19 8 */ 9 10 #incl... 阅读全文
posted @ 2018-07-19 11:17 LeeSongt 阅读(308) 评论(0) 推荐(0)
摘要:1 /* 2 题意:最短路 3 思路:spfa 4 时间:2018.07.18 5 */ 6 #include 7 using namespace std; 8 9 typedef long long LL; 10 const int MAXN=100005; 11 const LL MOD7 = 1e9+7; 12 13 struct Edge 14 { 1... 阅读全文
posted @ 2018-07-18 23:09 LeeSongt 阅读(214) 评论(0) 推荐(0)
摘要:1 /* 2 题意:用1*2覆盖n*m的区域的方案数,n 8 using namespace std; 9 10 typedef long long LL; 11 const int MAXN=100005; 12 const LL MOD7 = 1e9+7; 13 14 int a[1<<5][1<<5]; 15 LL dp[1005][1<<5]; 16 int n,m; 1... 阅读全文
posted @ 2018-07-18 22:19 LeeSongt 阅读(136) 评论(0) 推荐(0)
摘要:1 /* 2 题意:n 7 using namespace std; 8 9 typedef long long LL; 10 const int MAXN=100005; 11 const LL MOD7 = 1e9+7; 12 13 int qsize[(10) 26 { 27 ++res; 28 x-=lowbit(x); 29 ... 阅读全文
posted @ 2018-07-18 20:45 LeeSongt 阅读(174) 评论(0) 推荐(0)
摘要:1 /* 2 题意: 3 题解: 4 时间: 5 */ 6 7 #include 8 using namespace std; 9 10 typedef long long LL; 11 const int MAXN = 100005; 12 const LL MOD7 = 1e9+7; 13 14 struct Edge 15... 阅读全文
posted @ 2018-07-18 16:14 LeeSongt 阅读(234) 评论(0) 推荐(0)
摘要:1 /* 2 题意:给定一个数,修改u->v路径上的点权,查询每点的值 3 题解:基于点权 4 时间:2018.07.18 5 */ 6 7 #include 8 using namespace std; 9 10 typedef long long LL; 11 const int MAXN = 100005; 12 const LL... 阅读全文
posted @ 2018-07-18 15:22 LeeSongt 阅读(181) 评论(0) 推荐(0)
摘要:1 /* 2 题意:二分图匹配 3 题解: 4 时间:2018.07.18 5 */ 6 7 #include 8 using namespace std; 9 10 typedef long long LL; 11 const int MAXN = 100005; 12 const LL MOD7 = 1e9+7; 13 14 struct Edge 15... 阅读全文
posted @ 2018-07-18 11:34 LeeSongt 阅读(132) 评论(0) 推荐(0)
摘要:1 /* 2 题意:最近公共祖先 3 题解:tarjan算法实现 4 时间:2018.07.18 5 */ 6 7 #include 8 using namespace std; 9 10 typedef long long LL; 11 const int MAXN = 100005; 12 const LL MOD7 = 1e9+7... 阅读全文
posted @ 2018-07-18 11:17 LeeSongt 阅读(145) 评论(0) 推荐(0)
摘要:1 /* 2 题意:POJ2796 给定一个长度为n的数组,求sum(a[i])*min(a[i)最大的一段区间。 3 思路:枚举每个a[i],求最左边和最右边的距离。利用单调栈求左右区间 4 时间:2018.07.17 5 */ 6 // #include 7 #include 8 #include 9 using namespace std; 10 11... 阅读全文
posted @ 2018-07-17 22:17 LeeSongt 阅读(123) 评论(0) 推荐(0)
摘要:1 /* 2 题意:n,k 7 #include 8 #include 9 using namespace std; 10 11 typedef long long LL; 12 const int MAXN=1000005; 13 const LL MOD7 = 1e9+7; 14 15 int a[MAXN]; 16 int n,K; 17 18 struct Nod... 阅读全文
posted @ 2018-07-17 21:10 LeeSongt 阅读(139) 评论(0) 推荐(0)
摘要:1 #include 2 using namespace std; 3 4 typedef long long LL; 5 const int MOD7 = 1e9 + 7; 6 const int MOD9 = 1e9 + 9; 7 const int imax_n = 1e5 + 7; 8 LL add(LL a, LL b, LL mod) 9 { ... 阅读全文
posted @ 2018-07-13 08:26 LeeSongt 阅读(1111) 评论(0) 推荐(0)
摘要:1 /* 2 题意:1 7 using namespace std; 8 9 typedef long long LL; 10 const int MAXN=100005; 11 const LL MOD7 = 1e9+7; 12 13 int check[MAXN]; 14 int prime[MAXN]; 15 int mu[MAXN]; 16 int fmu[MAXN];... 阅读全文
posted @ 2018-07-11 22:42 LeeSongt 阅读(171) 评论(0) 推荐(0)