n个点,每个初始值为零,m个操作,共三种操作:
1 k d - "add"
2 l r - "query sum"
3 l r - "change to nearest Fibonacci"
1 ≤ n ≤ 100000, 1 ≤ m ≤ 100000, |d| < 231...
分类:
其他好文 时间:
2014-07-30 10:03:53
阅读次数:
246
题意:用所给的硬币面值构成所需的面值
思路:因为所用硬币数量不限,所以很容易想到完全背包。
递推:
#include
#include
#include
#include
using namespace std;
const int MAXN = 10005;
int n;
int coin[] = {1, 5, 10, 25, 50};
long long d...
分类:
其他好文 时间:
2014-07-29 15:02:39
阅读次数:
214
很灵活的题目,题意简单,看到又是钱币问题,类似于那种给了一定数目T,有n种钱币,每种的价值,让你组合成总价值为T的方案数,但是加了一些限制条件,那就是某些种类钱币数量必须大于另一些种类的,加了个限制条件 我就脑残了,唉智商看来是真不够啊 ,后来看了别人的分析
倘若种类a的钱币数量必须要大于种类b的数量,那么如果我要 去 m张b种类的钱币,其实同时也是相当于已经取了m张a种类的,因为a必须大于b的...
分类:
其他好文 时间:
2014-07-29 14:34:58
阅读次数:
295
下载apache2.2 http server,安装next,见到set type,选择custom类型安装,change改变安装路径,next到finsh安装完成,默认80端口,打开浏览器http://localhost,show view "it works !"成功安装。 配置环境变量...
分类:
其他好文 时间:
2014-07-29 11:23:36
阅读次数:
244
Coin Toss
Time Limit: 5000MS
Memory Limit: 65536K
Total Submissions: 3019
Accepted: 817
Description
In a popular carnival game, a coin is tossed onto a table with a...
分类:
其他好文 时间:
2014-07-28 15:54:53
阅读次数:
418
问题:横竖屏切换时Activity的生命周期?答案:1、不设置Activity的android:configChanges时,切屏会重新调用各个生命周期,切横屏时会执行一次,切竖屏时会执行两次2、设置Activity的android:configChanges=”orientation”时,切屏还是...
分类:
移动开发 时间:
2014-07-27 22:20:59
阅读次数:
271
If you have lost or forgot root password of RHEL7, you can follow this step to change to a new password, this is different with the RHEL6 single-user mode...
分类:
其他好文 时间:
2014-07-26 02:49:36
阅读次数:
276
1、How Do I change extension of php file RewriteEngine?On
RewriteCond?%{REQUEST_FILENAME}?!-f
RewriteRule?^(.*)\.html$?$1.php?[L]...
分类:
其他好文 时间:
2014-07-25 11:39:41
阅读次数:
255
Private Sub Worksheet_Change(ByVal Target As Range)Dim srg As Range, x As ShapeIf Target.Count = Target.EntireRow.Cells.Count Then For Each x In Shape...
分类:
其他好文 时间:
2014-07-25 03:50:35
阅读次数:
237
提交时忘记编写日志,事后想在版本库浏览器中编辑日志信息,却弹出错误,“此版本库不允许修改版本属性请管理员创建pre-revprop-change钩子”。解决方法如下: 在版本库的hooks目录中,新建pre-revprop-change.ba...
分类:
其他好文 时间:
2014-07-25 00:11:44
阅读次数:
285