• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
泳裤王子
不要挂科..
博客园 首页 新随笔 联系 订阅 订阅 管理

2011年9月19日

CSDN 越来越垃圾了,越改版用户体验越差。还tm只让用3个这么丑的模板,css都不开。靠~
摘要: 弄分类弄恶心了,吐槽飘过~。 阅读全文
posted @ 2011-09-19 22:43 泳裤王子 阅读(236) 评论(0) 推荐(0)
 
POJ 3468 A Simple Problem with Integers
摘要: 分析:这题wa了好多次(看了下discuss好多人也是这样,好题~)。一处是sum值会超int32,要用int64。还有一处是toadd要累加,我不知道是受上一题影响还是怎的..pushdown的时候直接替换了...还有,据说北大oj要用%lld读..类型:成段更新。容易错. 线段树(貌似这题也能用树状数组做?......)代码://3wa #include<cstdio> #include<cstring> #include<iostream> using namespace std; #define MAXN 100002 #define int64 l 阅读全文
posted @ 2011-09-19 22:37 泳裤王子 阅读(109) 评论(0) 推荐(0)
 
HDOJ 1698 Just a Hook
摘要: 分析: 只查询一次(总和)。toadd 表示以下全部替换为此值(而不是累加)。初始每个结点为1。类型:成段更新(lazy标记)。线段树......(ps. 据说树状数组能做成段的?怎么做?再说~...代码://颜色:1 2 3 //You may consider the original hook is made up of cupreous sticks. #include<cstdio> #include<cstring> #include<iostream> using namespace std; #define lc e<<1 #de 阅读全文
posted @ 2011-09-19 22:31 泳裤王子 阅读(167) 评论(0) 推荐(0)
 
HDOJ 1394 Minimum Inversion Number
摘要: 分析:前段时间做的,大概是先求逆序数,再根据这个O(m)推出可能的最大逆序数。类型:单点更新, 树状数组 / 线段树代码(树状数组):#include<cstdio> #include<cstring> using namespace std; #define MAXN 5002 #define INF 1<<30 #define LOWBIT(x) x&(-x) int c[MAXN]; int a[MAXN]; //原序 int n; void insert(int e) { while(e<=n) { c[e]+=1; e+=LOWBIT 阅读全文
posted @ 2011-09-19 22:24 泳裤王子 阅读(140) 评论(0) 推荐(0)
 
HDOJ 1166 敌兵布阵
摘要: 全裸的单点更新....代码:#include<cstdio> #include<cstring> #include<iostream> using namespace std; #define MAXN 50002 struct node { int mid, l, r; int v; }a[MAXN*4]; // 4倍? int n; void pushUp(int e) { a[e].v = a[e<<1].v+a[e<<1|1].v; } void build(int l, int r, int e) //CALL: build 阅读全文
posted @ 2011-09-19 22:20 泳裤王子 阅读(134) 评论(0) 推荐(0)
 
HDOJ 1754 I Hate It
摘要: 类型:单点更新,线段树 / 树状数组代码:#include<cstdio> #include<cstring> #include<algorithm> using namespace std; inline int Rint() {int x; scanf("%d", &x); return x;} #define MAXN 200002 //#define MAX(x, y) (x)>(y)? (x):(y) 用这个算MAX(ret, query(L, R, a[e].mid+1, r, e<<1|1)),会超 阅读全文
posted @ 2011-09-19 22:18 泳裤王子 阅读(174) 评论(0) 推荐(0)
 
 

公告


博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3