摘要: 洛谷P3865 注意:位运算一定要加括号!因为他的优先级没有加减法高; 注意在预处理的时候判断的是前一个区间是否完整,故 i+(1<<(j-1))-1<=n; 取logn时最好多加一位,以保漏掉数字 与LCA要分清! 阅读全文
posted @ 2017-11-02 00:38 Slager_Z 阅读(176) 评论(0) 推荐(0) 编辑
摘要: //只能写出裸的动规,为什么会有人能想到用单调队列优化Orz 题目描述 最近lxhgww又迷上了投资股票,通过一段时间的观察和学习,他总结出了股票行情的一些规律。 通过一段时间的观察,lxhgww预测到了未来T天内某只股票的走势,第i天的股票买入价为每股APi,第i天的股票卖出价为每股BPi(数据保 阅读全文
posted @ 2017-11-01 14:26 Slager_Z 阅读(207) 评论(0) 推荐(0) 编辑
摘要: //神题目(题目一开始就理解错了)。。。 题目描述 Why did the cow cross the road? Well, one reason is that Farmer John's farm simply has a lot of roads, making it impossible 阅读全文
posted @ 2017-10-30 11:02 Slager_Z 阅读(506) 评论(0) 推荐(1) 编辑
摘要: 以前只知道数组赋值时用memset(); 而这几天却了解到了一个函数:fill(); 感觉以后会有用吧。。。 std::fill template <class ForwardIterator, class T> void fill (ForwardIterator first, ForwardIt 阅读全文
posted @ 2017-10-29 21:42 Slager_Z 阅读(468) 评论(0) 推荐(0) 编辑
摘要: 蒜头君的排序(sort) 2000ms 262144K 蒜头君是一个爱思考的好孩子,这一天他学习了冒泡排序,于是他就想,把一个乱序排列通过冒泡排序排至升序需要多少次交换,这当然难不倒他,于是他想来点刺激的,给定一个1…n1的排列,每次从该排列中选择一个区间[l,r],问使用冒泡排序将该区间排至升序需 阅读全文
posted @ 2017-10-29 14:53 Slager_Z 阅读(389) 评论(0) 推荐(0) 编辑
摘要: 题目描述 The first stage of train system reform (that has been described in the problem Railways of the third stage of 14th Polish OI. However, one needs 阅读全文
posted @ 2017-10-19 22:33 Slager_Z 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Farmer John has decided to give each of his cows a cell phone in hopes to encourage their social interaction. This, however, requires him to set 阅读全文
posted @ 2017-10-19 10:01 Slager_Z 阅读(884) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Farmer John and his herd are playing frisbee. Bessie throws the frisbee down the field, but it's going straight to Mark the field hand on the oth 阅读全文
posted @ 2017-10-17 18:36 Slager_Z 阅读(267) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Farmer John is at the market to purchase supplies for his farm. He has in his pocket K coins (1 <= K <= 16), each with value in the range 1..100, 阅读全文
posted @ 2017-10-17 09:52 Slager_Z 阅读(330) 评论(0) 推荐(0) 编辑
摘要: 虫洞(wormhole) FJ 在农场上闲逛时,发现他的农场里有很多虫洞。虫洞是一条特殊的有向路径,当 FJ 从它的一头走到另一头后,他将被传送到过去的某个时刻。FJ 的每个农场包括 N(1<=N<=500)块按1..N 编号的草地、M(1<=M<=2500)条草地间的道路以及W(1<=W<=200 阅读全文
posted @ 2017-10-15 23:35 Slager_Z 阅读(579) 评论(0) 推荐(0) 编辑
博客园 首页 私信博主 显示目录 隐藏目录 管理 动画