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

2014年9月23日

hdu 4107 Gangster 线段树(成段更新)
摘要: 维护每个区间的最小值和最大值,update的时候判断low[rt]与up[rt]和p的大小关系,进行更新操作。卡时卡得很紧。#include #include #include #include #include #define lson l,m,rtb)return a; return b;... 阅读全文
posted @ 2014-09-23 20:30 asdflkj 阅读(209) 评论(0) 推荐(0)
 
hdu 3037 Saving Beans (lucas定理)
摘要: 考虑加多一颗树,这样的话当加的树放了k(0#include #include #include #include using namespace std;typedef long long ll;ll n,m,p;ll POW(ll x,ll n,ll p){ ll res=1; whi... 阅读全文
posted @ 2014-09-23 13:18 asdflkj 阅读(235) 评论(0) 推荐(0)
 
hdu 3944 DP? (Lucas 定理)
摘要: 仔细观察杨辉三角后可以发现从最高点到第n行第k个数的最短路为c(n+1,k);根据Lucas定理可以求出,一般来说要求答案模去一个质数p且p的范围不大于10^5则可用Lucas.Lucas(n,m,p)=cm(n%p,m%p)* Lucas(n/p,m/p,p)Lucas(x,0,p)=1;另外注意... 阅读全文
posted @ 2014-09-23 00:31 asdflkj 阅读(205) 评论(0) 推荐(0)
 
 

公告


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