- 博客(6)
- 资源 (3)
- 收藏
- 关注
原创 最大连续字段和 在线算法求解
在线算法求解 最大连续子段和#include<stdio.h>int main(){ int n; scanf("%d",&n); int a[n]; for(int i = 0; i < n; ++i) scanf("%d",&a[i]); int maxsum = 0; int nowsum...
2019-03-01 15:23:44 261 1
原创 ZOJ3911 Prime Query线段树
链接Prime QueryTime Limit: 5 Seconds Memory Limit: 196608 KBYou are given a simple task. Given a sequence A[i] with N numbers. You have to perform Q operations on the given sequence.Here are th...
2019-01-19 17:02:45 84
原创 POJ3468 A Simple Problem with Integers
链接线段树的入门题打延迟标记#include<stdio.h>const int maxn = 1e5+10;typedef long long LL;struct st{ int l,r; LL sum; LL add;//延迟标记} t[maxn*4];LL a[maxn];void build(int p,int l,int r){...
2019-01-18 15:33:14 91
原创 HDU1754 I hate it 线段树入门题
链接线段树入门题#include<stdio.h>#include<algorithm>using namespace std;const int maxn = 2e5+10;struct SegmentTree{ int l,r; int dat;} t[maxn*4];/*建树 build(1,1,n)并在每个节点上保存了对应区间的...
2019-01-17 21:03:21 163
原创 HDU1166 敌兵布阵 线段树入门
简单的线段树入门题(终于入门,线段树是个好东西)#include&lt;stdio.h&gt;#include&lt;string.h&gt;#include&lt;algorithm&gt;using namespace std;const int maxn = 5e4+10;struct ST{ int l,r; int sum;} t[maxn*4];int...
2019-01-17 20:41:53 102
原创 POJ1200 Crazy Search
POJ1200 Crazy Search题意:给定一个字符串,其中含有不同的字母数量为m,现在求这个字符串中有多少个长度为n且长的互不相同的字符子串 字符串hash板子题,手动去重。这个题目卡了一下map和set #include<stdio.h>#include<vector>#include<algorithm>#include<stri...
2019-01-16 19:46:35 115
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人