随笔分类 -  ACM~线段树/树状数组

摘要:忘记里给改过的字符替换掉 自己没有想到两个端点如果中间容纳不下3个字符的时候输出0 后来看了别人的代码 改过这两处才对 GPandaDescriptionWhen I wrote down this letter, you may have been on the airplane to U.S.We have known for 15 years, which has exceeded one-fifth of my whole life. I still remember the first time we went to the movies, the first time we wen 阅读全文
posted @ 2011-09-18 20:35 Crazy_yiner 阅读(832) 评论(0) 推荐(0)
摘要:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3279AntsTime Limit:2 Seconds Memory Limit:32768 KBecho is a curious and clever girl, and she is addicted to the ants recently.She knows that the ants are divided into many levels depends on ability, also, she finds the number of each level 阅读全文
posted @ 2011-07-27 17:49 Crazy_yiner 阅读(297) 评论(0) 推荐(0)
摘要:#include<iostream>#include<stdio.h>#include<string>using namespace std;#define MAX 50000int sum1;struct Node{ int left,right,sum;}stu[3*MAX];void CreateTree(int ii,int a,int b)//建树的结果只是形成一个空箱子 里面什么东西都没有 只有区间的两端{ stu[ii].left = a; stu[ii].right = b; stu[ii].sum = 0; if(a == b) { ret 阅读全文
posted @ 2011-07-14 16:13 Crazy_yiner 阅读(220) 评论(0) 推荐(0)
摘要:#include<iostream>#include<stdio.h>using namespace std;#define MAX 200001int big;struct Node{ int r,l,max;}s[MAX*3];int Max(int a,int b){ return a>b?a:b;}void creat(int i,int a,int b){ s[i].l=a; s[i].r=b; s[i].max=0; if(a==b) return; else { int mid=(a+b)>>1; creat(i*2,a,mid); cr 阅读全文
posted @ 2011-07-13 10:03 Crazy_yiner 阅读(357) 评论(1) 推荐(0)
摘要:L2B的演唱会Description著名乐队L2B宣布要在Music岛举办一场演唱会,售票当天那家伙,那场面,相当热闹,真是锣鼓喧天,鞭炮齐鸣,旌旗招展,人山人海啊。L2B的粉丝小C得知消息,飞奔到售票处,却发现买票的人已经排起了长龙的队伍,正当他万般绝望的时候,他看到了敬爱的PengSir,于是他向PengSir请求帮助。PengSir嘴角微微一笑,说道:票我倒是可以给你一张,可是白给的话就太没意思了,这样吧,我有一个问题考考你,如果你能在5秒钟内答出来的话,我就送你这张票,怎么样?小C急不可待的说:没问题。于是PengSir徐徐说道:这里排队的一共有N个人,每个人之前都发了一个号码牌(数字 阅读全文
posted @ 2011-05-16 22:39 Crazy_yiner 阅读(212) 评论(0) 推荐(0)