自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

lyjvactor的专栏

记录菜鸟的征程

  • 博客(37)
  • 资源 (4)
  • 收藏
  • 关注

原创 hdu_5150 水

交个题证明我还活着#include#include#include#includeusing namespace std;int main(){ int n; while(scanf("%d",&n)!=EOF) { int sum=0; int a; for(int i=0;i<n;i++){

2015-01-02 16:16:56 422

原创 hdu_2871

#include#include#include#include#include#include#define lson r,m,rt<<1#define rson m+1,r,rt<<1|1const int maxn=55555;using namespace std;int lsum[maxn<<2],rsum[rt<<2],sum[rt<<2];void pushUp

2014-11-14 09:42:09 407

原创 cpc,a wonderful concert

昨完这道题突然就感觉自己脑子是不是已经秀逗了

2014-11-11 21:00:47 412

原创 vimrc设置

参考自http://blog.csdn.net/dinosoft/article/details/6330121#

2014-11-08 19:38:50 567

原创 hdu_3308 区间合并

一两个月没写代码的确是手生的厉害,

2014-11-06 19:59:08 387

原创 poj_3667线段树区间合并

对照着notonlysuccess大牛的代码写的

2014-11-02 19:51:32 348

原创 poj_2777线段树+位运算

第一次没想到用位运算,不

2014-11-02 12:22:03 419

原创 poj_3468,线段树成段更新

参考自http://www.notonlysuccess.com/index.php/segment-tree-complete/

2014-09-13 20:52:26 335

原创 hdu_2795,线段树,单点更新

#include#include#include#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1using namespace std;const int maxn=222222;int seq[maxn<<2];int h,w;void pushUp(int rt){ seq[rt]=max(seq[rt<<1],seq

2014-09-12 07:43:56 392

原创 hdu_1394,线段树求逆序数

http://www.notonlysuccess.com/index.php/segment-tree-complete/#include#include#include#include#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1using namespace std;const int maxn=5555;int sum[ma

2014-09-11 20:02:25 407

原创 hdu_1754,线段树单点更新,求区间最值

http://www.notonlysuccess.com/index.php/segment-tree-complete/#include#include#include#include#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1#define maxn 2222222using namespace std;int a[maxn

2014-09-10 17:51:46 436

原创 hdu_1166,线段树单点更新

在刷线段树,参考自http://www.notonlysuccess.com/index.php/segment-tree-complete/

2014-09-10 12:22:07 423

原创 poj_2481,Cows,树状数组

将e按从大到小排序,统计

2014-09-09 21:19:49 385

原创 poj_1195Mobile phones,二维树状数组

#include#include#include#includeusing namespace std;int a[1300][1300];int s;int lowbit(int x){ return x&(-x);}void add(int x,int y,int d){ for(int i=x;i<=s;i+=lowbit(i)) for(int

2014-09-05 20:11:16 374

原创 poj_2299Ultra-QuickSort,树状数组离散化

求逆序数#include#include#include#includeusing namespace std;struct node{ int num; int pos;};node st[500010];int reflect[500010];int a[500010];int n;bool cmp(node a,node b){ return

2014-09-04 22:14:39 413

原创 uva_11997,K Smallest Sums优先队列

#include#include#include#include#includeusing namespace std;int a[1000][1000];int n;struct Item{ int jx,sum; bool operator < (const Item& a)const{ return sum>a.sum; }};v

2014-09-03 17:50:22 388

原创 LA_3135优先队列

#include #include #include #include using namespace std;struct st{ int QNum,Period,time; bool operator < (const st& a) const{ return time>a.time||(time==a.time&&QNum>a.QNum); }

2014-09-03 13:21:48 325

原创 uva_127,栈以及vector的应用

参考自http://www.cnblogs.com/maqiang/archive/2012/05/02/2479760.html

2014-09-02 14:12:13 410

原创 poj_1974,最长回文字串manacher

时间复杂度为O(n),参考:http://bbs.dlut.edu.cn/bbstcon.php?board=Competition&gid=23474#include#include#include#include#define maxn 2001000using namespace std;char s[maxn],st[maxn];int p[maxn];int cases=

2014-08-23 12:21:24 438

原创 hdu_4430,二分

注意处理溢出#include#include#include#includeusing namespace std;long long n;long long a[60][2];int k;int fun(long long y,int x){ long long cnt=0,cur=1; for(int i=1; i<=x; i++) {

2014-08-21 17:33:51 338

原创 求凸包面积

#include#include#include#include#includeusing namespace std;struct Point{ double x,y; Point(double x=0,double y=0):x(x),y(y){}};typedef Point Vector;bool cmp_x(const Point &p,const Po

2014-08-21 14:00:53 436

原创 poj_2187求凸包直径

#include#include#include#include#includeusing namespace std;struct Point{ int x,y; Point(int x=0,int y=0):x(x),y(y){}};typedef Point Vector;bool cmp(const Point &p,const Point &q){

2014-08-21 13:58:32 385

原创 几何,求两整数点确定的线段上的整数点的个数

#include#include#include#include#includeusing namespace std;int gcd(int a,int b){ return a%b==0?b:gcd(b,a%b);}int main(){ int x1,x2,y1,y2; while(cin>>x1>>y1>>x2>>y2) {

2014-08-21 12:25:15 1010

原创 zoj_3657,12年长春站c题,模拟

#include#include#include#includeusing namespace std;int main(){ int n; int a[6]; while(scanf("%d",&n)!=EOF) { for(int i=0;i<n;i++) scanf("%d",&a[i]);

2014-08-18 21:47:02 347

原创 poj_2352树状数组

因为y已经排好序了,用x坐标ji

2014-08-11 18:20:23 321

原创 poj_2187凸包,暴力解法

#include#include#include#include#includeusing namespace std;struct Point{ int x,y; Point(int x=0,int y=0):x(x),y(y){}};typedef Point Vector;bool cmp(const Point &p,const Point &q){

2014-08-11 10:03:16 412

原创 zoj_3735,dp,长沙站j题

#include#include#include#includeusing namespace std;double a[10010][150];double dp[10010][150];int b[10010];int n;void solve(int cnt){ memset(dp,0,sizeof(dp)); for(int i=0;i<cnt;i++)

2014-08-10 07:37:03 346

原创 hdu_1698线段树成段更新

#include#include#include#include#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1using namespace std;const int maxn=100100;int sum[maxn<<2],col[maxn<<2];void pushUP(int rt){ sum[rt]=sum[r

2014-08-09 19:58:49 368

原创 poj_2828线段树,逆序插入

#include#include#include#include#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1const int maxn = 200020;using namespace std;int p[200020],v[200020];int sum[maxn<<2];int ans[maxn];void build

2014-08-09 12:50:05 355

原创 poj_3371

一道模拟题,写的有点麻烦

2014-08-08 21:11:42 366

原创 poj_3071概率dp

确定好对手就简单了。#include#include#include#includeusing namespace std;double a[150][150];double dp[9][150];int n;void solve(){ memset(dp,0,sizeof(dp)); for(int i=0;i<=(1<<n);i++) dp[0

2014-08-06 22:28:50 347

原创 hdu_2191多重背包

用二维数组解的,因为忘了memset害我wa

2014-06-05 16:46:09 479

转载 poj_1185状压dp

用二维数组写了好久,失败啊。。#include#include#include#includeusing namespace std;int n,m;int dp[110][110][110];char st[110][12];int s[110],an[110],as[110];int convert(int n){ int cnt=0; while(n>0)

2014-05-28 21:21:06 603

原创 poj_1952最大下降子序列,统计个数

其实不算难的一道题,但憋了我好久,嗯,很s

2014-05-28 21:16:38 687

转载 poj_3468线段树成段更新求区间和

#include#include#includelong long num[100010];using namespace std;struct st{ int l; int r; long long sum; long long a;} p[400100];void build(int t,int l,int r){ p[t].l=l;

2014-05-20 14:21:08 533

原创 hdu_4707

算是水题一道吧,看别人又用vector,you

2014-05-07 06:33:56 419

原创 uva_644暴力加字典树解法

暴力#include#include#includeusing namespace std;int main(){ int t=0,i=0; char s[10][12]; bool a[12][12]; memset(s,'\0',sizeof(s)); while(scanf("%s",s[i])!=EOF) { if(

2014-05-05 20:36:02 467

谷歌输入法

谷歌输入法

2014-08-30

chrome谷歌

chrome谷歌

2014-08-30

标准模板库自修教程

标准模板库自修教程

2014-08-30

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除