• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
LyonLys
愿意在角落唱沙哑的歌 再大声也都是给你 请用心听 不要说话 Contact me via E-mail: lyon.lys@gmail.com
博客园    首页    新随笔    联系   管理    订阅  订阅
2013年9月2日
树状数组(Binary Index Tree)
摘要: 一维BIT(单点更新,区间求和):Problem - 1166 1 #include 2 #include 3 #include 4 #include 5 6 using namespace std; 7 8 const int N = 111111; 9 typedef long long LL;10 inline int lowbit(int x) { return x & -x;}11 struct BIT {12 LL s[N], sz;13 void init(int n) { sz = n; for (int i = 1; i 0; x -= lowb... 阅读全文
posted @ 2013-09-02 23:13 LyonLys 阅读(406) 评论(0) 推荐(0)
hdu 4128 Running relay (线性规划转半平面交)
摘要: Problem - 4128 对偶线性规划转半平面交,这题的正解O(nlogn)解法,目前网上没有找到这样的正解。 原来的不等式组,sigma{-si*xi}>=-W+d*sigma{si}sigma{xi}>=L-n*dsigma{-xi}>=-L+n*dxi>=0T=sigma{ti*xi}+d*sigma{ti},求Min(T)。 用线性规划对偶性,变成了-si*x+y=0,y无限制T'=(-W+d*sigma(si))*x+(L-nd)*y+d*sigma{ti},求Max(T')。——written by Lyon 阅读全文
posted @ 2013-09-02 11:55 LyonLys 阅读(413) 评论(1) 推荐(0)
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3