题意:n门课程用m天来学习,每门课用不同的天数来学习会有不同的学分,求能得到的最大的学分
分析:第一次接触分组背包。分组背包的模型就是不同的物品有不同的花费和价值,求在规定花费内能得到的最大的价值,这前面跟以前的背包最大的不同是物品分为几组,每组内的物品最多只能选一种;dp[i][j]表示前i组花费j能得到的最大的价值,不过实际在做的时候用一维数组就可以了
公式:
for 组i
f...
分类:
其他好文 时间:
2015-06-23 23:14:26
阅读次数:
157
实现的思路: 首先,需要创建一个Servlet。该Servlet通过字节型响应给客户端返回一个图片,该图片是通过JDK中Java 2D的类库来生成一个图片。图片的生成是依靠一个随机数来完成,然后将这个随机数写成图片格式。最后在Session将这个随机的字符串的状态保持住,以便在用户填写后进行对比。 其次,在需要加入验证码的JSP页面中,通过引入该图片。 最后,单用户填写完验证码后,提交到某一个Se...
分类:
其他好文 时间:
2015-06-23 23:12:15
阅读次数:
184
树链剖分第一题QAQ,纪念下
#pragma comment(linker, "/STACK:102400000,102400000")
#include
#include
#include
using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;
const int maxn = 1e5 + 10;
#d...
分类:
其他好文 时间:
2015-06-23 23:11:32
阅读次数:
118
A message containing letters from A-Z is being encoded to numbers using the following mapping:
'A' -> 1
'B' -> 2
...
'Z' -> 26
Given an encoded message containing digits, determine the total number of ways to...
分类:
其他好文 时间:
2015-06-23 23:10:22
阅读次数:
196
Django添加JS,CSS,图片等外部文件的方法在使用Django搭建网站时,往往需要使用一些js,css或者图片等外部文件,这里给出使用它们的用法。
我的django版本为:1.8.2
假设我们有工程如下:
sentiment_analysis
|-mysite
| |-mysite
| |-manage.py
| |-show_pages
| | |...
分类:
其他好文 时间:
2015-06-23 23:10:11
阅读次数:
146
所谓的适配器就是底层利用仿函数,然后修改仿函数的接口,达到自己的目的;例如:templateclass binder1st的适配器,其本质是一个类,它的模板参数operation其实是仿函数类(仿函数其实是struct类),内部函数调用operator()(const typename Operat...
分类:
其他好文 时间:
2015-06-23 23:10:14
阅读次数:
135
Bootstrap中禁用滚动条的方法逻辑:当点击弹窗按钮后,js会为body元素添加一个modal-open的类,该类主要内容如下.modal-open .modal { overflow-x: hidden; overflow-y: auto;}说明:modal-open使用在body上,mo.....
分类:
其他好文 时间:
2015-06-23 23:11:11
阅读次数:
264
backtrack5安装完毕后,使用putty远程登录时显示network error:Connection refused解决方法:登录系统(系统默认用户名密码是root/toor,startx可以进入图形界面)在命令终端输入命令,#sshd-generate(系统可能会询问是否覆盖,全部选Y)。...
分类:
其他好文 时间:
2015-06-23 23:10:32
阅读次数:
107
栀子飘香,又逢一年毕业时,在这一淡淡的,涩涩的季节里,我将我心中仅存的记忆通过初夏这一沁人的晨风,转化成了这一季节里纯纯的素香,幽幽的,幽幽的。淡淡的栀子花香,满空弥漫着属于这一季特有的离绪。花香夹杂着心绪,通过初夏这一微微的晨风,使我将曾经的记忆重新拾起,在脑海中浮现着一个个属于我们的故事。我.....
分类:
其他好文 时间:
2015-06-23 23:10:39
阅读次数:
134
1.下载office 2013激活工具:microsoft toolkit2.解压文件,运行Microsoft Toolkit.exe,选择office,即箭头标识处3.选择Activation,默认选项,点击install4.点击Activate,完成激活操作
分类:
其他好文 时间:
2015-06-23 23:07:54
阅读次数:
180
目录程序集加载获取类型信息构造类型实例通过反射发现成员调用成员一、程序集加载Load方法:CLR通过调用System.Rreflection.Assemblly类的静态方法来显示加载程序集。public static Assembly Load(AssemblyName assemblyRef);p...
分类:
其他好文 时间:
2015-06-23 23:08:46
阅读次数:
145
NoteOn file systems which support symlinks, the directory containing the input script is calculated after the symlink is followed. In other words the ...
分类:
其他好文 时间:
2015-06-23 23:07:24
阅读次数:
195
今天刚买到DHT11温湿度传感器,用手头的STM32F030R8T6写了一个测试程序 实验环境: KEIL 5.12 + STM32CubeMX4.6 + STM32Cube1.0 STM32F030R8T6 测试原理: DHT11是 one wire 通信,这里使用的PC4 作为通信口, DHT1...
分类:
其他好文 时间:
2015-06-23 23:08:42
阅读次数:
247
1. Question罗马数转为整型,输入确保在1-3999之内。相似的题目是Integer to RomanGiven a roman numeral, convert it to an integer.Input is guaranteed to be within the range from...
分类:
其他好文 时间:
2015-06-23 23:07:36
阅读次数:
138
LCT...----------------------------------------------------------------#include#include#include#include#define rep( i , n ) for( int i = 0 ; i s + ch[....
分类:
其他好文 时间:
2015-06-23 23:07:53
阅读次数:
468
Add Two NumbersYou are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes co...
分类:
其他好文 时间:
2015-06-23 23:08:04
阅读次数:
207
Leetcode 03 Longest Substring Without Repeating CharactersGiven a string, find the length of the longest substring without repeating characters. For e...
分类:
其他好文 时间:
2015-06-23 23:07:53
阅读次数:
115