上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 63 下一页
摘要: ``` #include #include #include #include #include using namespace std; int read() { int res=0,ch,flag=0; if((ch=getchar())=='-') //判断正负 flag=1; else if(ch>='0'&&ch='0'&&ch0) f[u]+=f[v]; } } bool vis[N] 阅读全文
posted @ 2020-03-21 20:47 晴屿 阅读(110) 评论(0) 推荐(0) 编辑
摘要: ``` #include #include #include #include using namespace std; const int N=2010; int a[N],f[N][N]; int read() { int res=0,ch,flag=0; if((ch=getchar())=='-') //判断正负 flag=1; else if(ch>='0'&&ch='0'&&ch<=' 阅读全文
posted @ 2020-03-21 20:30 晴屿 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 一开始输出的必定为n,初始时,1~pos[n]都+1,只要tr[1].v 0,那么就说明,不存在位置大于等于pos[k]的炸弹 然后依次进行修改,处理1~q[n],如果tr[1].v include include include using namespace std; typedef long 阅读全文
posted @ 2020-03-21 17:11 晴屿 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 自己写的不知道为什么,degug一下午,还是t,吐了 然后参考大佬的博客https://www.jianshu.com/p/af3cc413d299 阅读全文
posted @ 2020-03-19 18:31 晴屿 阅读(109) 评论(0) 推荐(0) 编辑
摘要: ```#include#include#include#include#includeusing namespace std;const int N=1e5+10;int tr[N][130],n,m,idx,ne[N],ed[N],cnt,cas=1;int vis[N];char str[N];void insert(char str[],int id){ int len=strlen(str... 阅读全文
posted @ 2020-03-19 12:04 晴屿 阅读(87) 评论(0) 推荐(0) 编辑
摘要: ``` //ac自动机 可以优化成 trie图 #include #include #include #include using namespace std; const int N = 10010, S = 55, M = 1000010; int n; //tire 以每个节点结尾的单词数量 int tr[N * S][26], cnt[N * S], idx; //字符串 char str 阅读全文
posted @ 2020-03-19 10:51 晴屿 阅读(102) 评论(0) 推荐(0) 编辑
摘要: ``` //将含有N个元素的一个集合分成M个子集,使得每个子集的最大值与最小值平方差的和最小。 #include #include #include #include using namespace std; typedef long long ll; const int maxn = 1e4+50; const int maxm = 5e3+50; ll dp[maxn][maxm] ,v[ma 阅读全文
posted @ 2020-03-18 18:11 晴屿 阅读(82) 评论(0) 推荐(0) 编辑
摘要: 参考博客https://blog.csdn.net/qq_26572969/article/details/47155559 阅读全文
posted @ 2020-03-18 18:02 晴屿 阅读(118) 评论(0) 推荐(0) 编辑
摘要: ```#include#include#include#includeusing namespace std;const int N=1e5;int val[N],sum[N],dp[N];int q[N],r,l;int getup(int r,int l) { return dp[r]-dp[l];}int getdown(int r,int l) { return sum[r]-... 阅读全文
posted @ 2020-03-18 17:44 晴屿 阅读(59) 评论(0) 推荐(0) 编辑
摘要: ``` #include #include #include #include using namespace std; typedef long long ll; const int N= 500000+10; int q[N],l,r; ll sum[N],val[N]; ll dp[N]; int n,m; ll getdown(int j,int k) { return val[j+1]- 阅读全文
posted @ 2020-03-18 17:40 晴屿 阅读(57) 评论(0) 推荐(0) 编辑
上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 63 下一页