随笔分类 - 杂-位运算优化
摘要:You have a map as a rectangle table. Each cell of the table is either an obstacle, or a treasure with a certain price, or a bomb, or an empty cell. Yo
阅读全文
摘要:You are given n strings s1, s2, ..., sn consisting of characters 0 and 1. m operations are performed, on each of them you concatenate two existing str
阅读全文
摘要:Snark and Philip are preparing the problemset for the upcoming pre-qualification round for semi-quarter-finals. They have a bank of nproblems, and the
阅读全文
摘要:第一题就是一个很简单的dp,这么想就很好想出dp方程了 前面的序列是有1到(i - 1)组成,将i插在最前面,将会增加i - 1个逆序对 如果插在第一个数的后面,将会增加i - 2个逆序对。。。以此类推 于是得到了dp方程: 有一点长,也可以用f[i][j - 1]来状态转移,这样方程很简单得多,
阅读全文
摘要:【问题描述】 一年一度的科技节即将到来。同学们报名各项活动的名单交到了方克顺校长那,结果校长一看皱了眉头:这帮学生热情竟然如此高涨,每个人都报那么多活动,还要不要认真学习了?!这样不行!……于是,校长要求减少一些活动,使每位学生只能参加一项(一名同学要参加某活动,必须已报名且该活动未被去掉)。当然,
阅读全文
摘要:Description Chosen Problem Solving and Program design as an optional course, you are required to solve all kinds of problems. Here, we get a new probl
阅读全文