上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 31 下一页
摘要: /*普通的hsah 由于元素太多 空间很小..hash碰撞很厉害.30分*/ #include #include #include #include #define maxn 100010 #define mod 2000007 #define hs 117 using namespace std; int n,l,k,cnt,f[mod+10],l1[maxn],l2[maxn]; char ... 阅读全文
posted @ 2016-08-08 21:08 一入OI深似海 阅读(851) 评论(0) 推荐(0) 编辑
摘要: /*数论题 考察唯一分解定理 当然用到一些技巧*/ #include #include #include #define maxn 30010 using namespace std; int n,m1,m2,prime[maxn],num,mi[maxn],S,s[maxn],ans=0x7fffffff,cnt; bool f[maxn]; void Get_prime(int x) { ... 阅读全文
posted @ 2016-08-06 22:23 一入OI深似海 阅读(343) 评论(0) 推荐(0) 编辑
摘要: /*10分钟的暴力 意料之中的5分..*/ #include #include #include #define maxn 1010 using namespace std; int n,m,p,g[maxn][maxn],w[maxn],ans; void Dfs(int now,int v) { if(now>m){ans=max(ans,v);return;} for(in... 阅读全文
posted @ 2016-08-06 22:21 一入OI深似海 阅读(926) 评论(0) 推荐(0) 编辑
摘要: /*暴力+乱搞 55分(似乎只有暴力得分了)*/ #include #include #include #include #include #define maxn 1000010 using namespace std; int n,m,num,head[maxn],dfn[maxn],low[maxn],s[maxn],top,f[maxn]; int sum,topt,c[maxn],di... 阅读全文
posted @ 2016-08-05 15:21 一入OI深似海 阅读(138) 评论(0) 推荐(0) 编辑
摘要: /* 矩阵稍微有点难搞 不过也是可以推出来 注意防爆... */ #include #include #include #define ll long long using namespace std; ll n,mod,p,q,r,t,u,v,w,x,y,z; ll f[12][12],a[12][12]; ll slow_mul(ll a,ll b) { ll ans=0; ... 阅读全文
posted @ 2016-08-04 19:54 一入OI深似海 阅读(365) 评论(0) 推荐(0) 编辑
摘要: /*考试想了2小时二分 最后写的15分钟暴力....34分*/ #include #include #include #include using namespace std; int n,m,k,cnt,ks[11],sk[11]; string s,si; void Get_s(int x) { string sd; while(x)sd+=char(x%10+'0'),x/... 阅读全文
posted @ 2016-08-04 17:15 一入OI深似海 阅读(201) 评论(0) 推荐(0) 编辑
摘要: /*暴力30分*/ #include #include #include #include #define maxn 100010 using namespace std; int n,l=0x7fffffff,r=-0x7fffffff; int s,ans1[maxn*5],ans2[maxn*5],h[maxn]; struct node { int li,ri,hi; }p[ma... 阅读全文
posted @ 2016-08-03 21:37 一入OI深似海 阅读(197) 评论(0) 推荐(0) 编辑
摘要: /* 状态f[i][j][k] 表示A串匹配到i B串匹配到j 用了k个子串 转移的话 f[i][j][k]=f[i-1][j-1][k]+f[i-1][j-1][k-1]分别表示i是不是建立了一个新的子串 当然这是我们会发现 这样的状态是默认了i用了 显然i可以不用 也就是说这样就遗漏了许多状态 我们重新定义一下他 加一维01表示i用了没用 f[i][j][k][0或1] 这样转移就要分开考虑... 阅读全文
posted @ 2016-08-02 19:53 一入OI深似海 阅读(1151) 评论(1) 推荐(0) 编辑
摘要: #include #include #include #define maxn 2010 using namespace std; int n,m,v[maxn],sum[maxn],son[maxn][maxn],s[maxn][3],f[maxn][maxn]; bool falg[maxn]; int Dfs(int k,int p) { if(k==0&&p!=m||p==0)r... 阅读全文
posted @ 2016-08-02 19:32 一入OI深似海 阅读(275) 评论(0) 推荐(0) 编辑
摘要: /* 不要思维定视 盯着线段树维护l r 的ans不放 显然没法区间合并 换一种思路 如果打暴力的话 O(nm) 每次询问 扫一遍之前所有的修改 有交点则说明种数++ 接下来考虑如何优化 我们把每个区间看做(l,r)的坐标内的点 然后查询区间L=l 所以l轴的[r+1,n] +r 轴的[1,l-1] 恰好不重复且覆盖了所有多出来的点 */ #include #include #includ... 阅读全文
posted @ 2016-08-01 11:25 一入OI深似海 阅读(145) 评论(0) 推荐(0) 编辑
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 31 下一页