随笔分类 -  Codeforces

摘要:E Boring Segments 双指针加线段树; 线段树维护区间覆盖问题,具体来说每个节点维护区间被完整覆盖的最小次数; 先将线段按照权值从小到大排序,seg[i]指下标i所对应的线段; 对于双指针l,r来说,r向右移的同时将seg[r]对应的线段覆盖,直到覆盖掉整个区间[1,m],此时再右移l 阅读全文
posted @ 2021-08-01 12:41 棉被sunlie 阅读(42) 评论(0) 推荐(0)
摘要:A. Boboniu Likes to Color Balls Boboniu gives you r red balls, g green balls, b blue balls, w white balls. He allows you to do the following operation 阅读全文
posted @ 2020-08-15 13:09 棉被sunlie 阅读(170) 评论(0) 推荐(1)
摘要:A. Donut Shops There are two rival donut shops. The first shop sells donuts at retail: each donut costs a dollars. The second shop sells donuts only i 阅读全文
posted @ 2020-06-26 17:24 棉被sunlie 阅读(305) 评论(0) 推荐(0)
摘要:A. Shovels and Swords Polycarp plays a well-known computer game (we won't mention its name). In this game, he can craft tools of two types — shovels a 阅读全文
posted @ 2020-06-13 21:13 棉被sunlie 阅读(286) 评论(0) 推荐(0)