ACdreamOJ 1154 Lowbit Sum (数位dp)
ACM
题目地址:ACdreamOJ 1154
题意:
long long ans = 0;for(int i = 1; i n; i ++) ans += lowbit(i)
lowbit(i)的意思是将i转化成二进制数之后,只保留最低位的1及其后面的0,截断前面的内容,然后再转成10进制...
分类:
其他好文 时间:
2014-07-31 13:35:46
阅读次数:
195
LOOPS
Problem Description
Akemi Homura is a Mahou Shoujo (Puella Magi/Magical Girl).
Homura wants to help her friend Madoka save the world. But because of the plot of the Boss Incubator, ...
分类:
其他好文 时间:
2014-07-31 13:31:27
阅读次数:
232
先将前n-1个从小到大排序,对m-5进行01背包,然后答案就是m-dp[m-5]-a[n-1]
至于为什么最后减去最贵的菜品,而不是把最贵的菜品也放到01背包里呢,
因为如果可以把最贵菜品a[n-1]可以放到背包里,那么其他菜品a[i]也一定可以放在背包里(背包的容量为m-5),最后都是减去a[i]+a[n-1],所以可以吧最贵的菜品不放入背包,直接最后减去...
分类:
其他好文 时间:
2014-07-31 13:28:26
阅读次数:
153
UVA 1401 - Remember the Word
[题目链接]
题意:给定一些单词,和一个长串,问这个长串拆分成已有单词,能拆分成几种方式
思路:Trie,先把单词建成Trie,然后进行dp,dp[i]表示以i为开头的情况,然后每个状态只要在Trie树上找到相应的i开头的单词,然后dp[i] = sum{dp[i + len]}进行状态转移即可
代码:
#in...
分类:
其他好文 时间:
2014-07-31 13:25:06
阅读次数:
195
mkisofs -r -J -V Beini-Custom -v --boot-info-table --boot-load-size 4 -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -o ../beini.iso beinisee...
分类:
系统相关 时间:
2014-07-31 12:59:06
阅读次数:
478
在做VLC开发的时候,想使用一个模块访问另外一个模块的数据, 比如在网络模块得到了一些数据,想在其他模块得到这些数据进行处理,这时候就需要两个模块共享一些变量。 查看VLC的源码,发现VLC专门有variables.h和variables.c是用来处理变量的。它提供了一些方法可以创建VLC变量...
分类:
其他好文 时间:
2014-07-31 12:56:46
阅读次数:
218
来源:http://poj.org/problem?id=3926题意:行n 2 #include 3 #include 4 using namespace std; 5 6 int n, m, k; 7 int a[120][10100], b[120][10100], dp[120][101.....
分类:
其他好文 时间:
2014-07-31 12:22:36
阅读次数:
269
前台:document.getElementById("").value = 3; document.getElementById("").click(); 后台: protected void btnSearch_Click(object sender, EventArgs e) { Bin...
分类:
其他好文 时间:
2014-07-31 12:16:16
阅读次数:
133
Rating
Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 714 Accepted Submission(s): 452
Special Judge
Problem Description
A little gi...
分类:
其他好文 时间:
2014-07-31 09:54:16
阅读次数:
303
Aeroplane chess
Problem Description
Hzz loves aeroplane chess very much. The chess map contains N+1 grids labeled from 0 to N. Hzz starts at grid 0. For each step he throws a dice(a dice hav...
分类:
其他好文 时间:
2014-07-31 09:49:57
阅读次数:
208