摘要:
对t进行从小到大排序(要记录ID),然后直接dfs。剪枝的话,利用A*的思想,假设之后的全部连击也不能得到更优解。因为要回溯,而且由于每次cut 的数目不会超过10,所以需要回溯的下标可以利用一个二进制保存。由于cut最多30个,所以方案也可以用一个二进制保存。#include#include#include#include#includeusing namespace std;bool vis[205];struct node{ int t; int f[205]; int top; int id;}cut[205];int n,m,w,ans;int p;int a...
阅读全文
posted @ 2013-08-25 21:09
you Richer
阅读(153)
推荐(0)
摘要:
做Androidapp开发的同学应该都听说过或者用过nostra13的Android-Universal-Image-Loader开源库,它在图片异步加载、缓存和显示等方面提供了强大灵活的框架。之前介绍过的android-smart-image-view开源库跟它比起来,真是小巫见大巫了,不仅在功能上,而且在代码量上都差别很大。当然我们在选取开源库的时候并不是功能越强大越好,一切都要看具体需求,只选取能够满足需求的就行,LessIsMore。 Android-Universal-Image-Loader可以到https://github.com/nostra13/Android-Univ...
阅读全文
posted @ 2013-08-25 21:07
you Richer
阅读(389)
推荐(0)
摘要:
书接上文。http://blog.csdn.net/i7788/article/details/10306595 首先是数据库的搭建,这里的django的数据模型搭建十分easy. no sql。just config file打开应用目录,下的setting.py 文件。找到 在这里配置你的数据库信息。(这里使用的是sqlite3)配置完毕,使用自带的命令,生成数据库文件:python manage.py syncdb (我相信你能看懂提示成功) 接下来创建一个应用,之前说过一个完整的网站由多个django应用构成。每一个django对于一个类型的操作,比如现在我们要做一个blog,那...
阅读全文
posted @ 2013-08-25 21:05
you Richer
阅读(352)
推荐(0)
摘要:
Balls RearrangementTime Limit: 9000/3000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 1682 Accepted Submission(s): 634 Problem Description Bob has N balls and A boxes. He numbers the balls from 0 to N-1, and numbers the boxes from 0 to A-1. To find the ball...
阅读全文
posted @ 2013-08-25 21:03
you Richer
阅读(225)
推荐(0)
摘要:
git的介绍可以看这里 http://zh.wikipedia.org/wiki/GitHub安装和使用参考的这个 http://www.cnblogs.com/cocowool/archive/2010/10/19/1855616.html常用操作为origin添加远程地址$git remote add origin git@github.com:yourName/yourRepo.git编辑好文件后就可以 $git add filename 再提交到本地 $git commit -m " "-m的引号里加你的备注 提交到你的github上 $git push orig.
阅读全文
posted @ 2013-08-25 21:00
you Richer
阅读(461)
推荐(0)
摘要:
首先来看看set集合容器:set集合容器实现了红黑树的平衡二叉树数据结构,在插入元素时它会自动调整二叉树的排列,把该元素放到适当的位置,并且保证左右子树平衡。平衡二叉检索树采用中序遍历算法。对于set,vector,map等等,它们的前向迭代器定义是这样的(以set为例):set::iterator it;for(it=s.begin();it!=s.end();it++){}那么反向迭代器呢?set::reverse_iterator rit;for(rit=s.rbegin();rit!=s.rend();rit++){}常用方法:insert(),erase(),find(),clear
阅读全文
posted @ 2013-08-25 20:58
you Richer
阅读(251)
推荐(0)
摘要:
来自《C++ primer》 问:C++为什么是C++而不是++C 答 :C++之名是Rick Mascitti在1983年夏天定名,c说明它的本质实在C语言演化而来的,”++“是C语言的自增操作符。C++语言是C语言的超集,是在C语言的基础上进行的扩展。是先有C语言。再进行++。根据自增操作符前,后置形式的差别。C++表示对C语言进行C语言扩展之后,还可以使用C语言的内容。而写成++C则表示无法再使用C的原始值。也就是说C++不能向下兼容C了,这与实际情况不符。
阅读全文
posted @ 2013-08-25 20:56
you Richer
阅读(299)
推荐(0)
摘要:
题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=4616 这道题目数据可能比较弱,搜索都可以AC,但是不敢写,哎…… 搜索AC代码:#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #pragma comment(linker, "/STACK:16777216")using
阅读全文
posted @ 2013-08-25 20:54
you Richer
阅读(149)
推荐(0)
摘要:
JNITestProjectJust learn how to use the JNIRefer :1. ant usage http://lmbj.net/blog/ant-build-android-project/2. tutorial Android JNI http://blog.edwards-research.com/2012/04/tutorial-android-jni/Step:1. reference > to create java wrapper class and .so library in project_one2. create the .j...
阅读全文
posted @ 2013-08-25 20:51
you Richer
阅读(130)
推荐(0)
摘要:
题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=4611 题意:给你一个N、A、B,要你求 AC代码:#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #pragma comment(linker, "/STACK:16777216")using namespace std;t
阅读全文
posted @ 2013-08-25 20:49
you Richer
阅读(242)
推荐(0)