2012年6月13日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2714水,按要求找到符合要求的解。。View Code #include <iostream>using namespace std ;int main(){ char str[30] ; int i ; while(~scanf("%s",str)) { int cnt=0 ; int pos ; for(i=0;str[i];i++) if(str[i]=='X') cnt+=10 ; ... 阅读全文
posted @ 2012-06-13 21:00 LegendaryAC 阅读(193) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4027线段树成段更新的题目,开方次数有限,一个区间都是1就lazy。仿hh风格的线段树,真漂亮啊View Code #include <iostream>#include <cmath>using namespace std ;#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1const int maxn=100002 ;typedef __int64 LL ;LL sum[maxn<<2] ;int l 阅读全文
posted @ 2012-06-13 19:44 LegendaryAC 阅读(187) 评论(0) 推荐(0) 编辑
 
摘要: 最近在自学数据结构,写了个最大堆模板,heap的大小到时候用malloc动态申请int heapsize, *heap;void up(int x){//自下而上调整堆 while(x != 1){ if(heap[x>>1] >1], heap[x]); ... 阅读全文
posted @ 2012-06-13 10:36 LegendaryAC 阅读(170) 评论(0) 推荐(0) 编辑