题目链接:hdu 4722 Good Numbers
题目大意:给出a,b,问从a到b之间,有多少个好数字,好数字的定义为:每个位的数字相加是10的倍数。
解题思路:dp[i][j]表示第i位,前i-1位的和为j(j可以从200简化成10,以为只需要考虑最后的数是否是10的倍数即可)有多少个数,需要注意的就是恰好为b的情况,所以要有一个跟踪值s。
#include
...
分类:
其他好文 时间:
2014-05-10 09:46:45
阅读次数:
232
链接:http://poj.org/problem?id=1789 或 http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1158
Description
Advanced Cargo Movement, Ltd. uses trucks of different types. Some trucks are use...
分类:
其他好文 时间:
2014-05-10 09:39:59
阅读次数:
440
链接:http://poj.org/problem?id=2421 或 http://acm.hdu.edu.cn/showproblem.php?pid=1102
Problem Description
There are N villages, which are numbered from 1 to N, and you should build some roads ...
分类:
其他好文 时间:
2014-05-10 09:34:09
阅读次数:
389
/*判断表AA中是否存在AA_ID这一列,如果不存在,则新增*/
IF NOT EXISTS (SELECT 1 FROM syscolumns INNER JOIN sysobjects ON sysobjects.id = syscolumns.id
WHERE syscolumns.name = 'AA_ID' AND sysobjects.name = 'AA')
ALTER TA...
分类:
数据库 时间:
2014-05-07 07:33:47
阅读次数:
373
The Little Elephant likes permutations. This time he has a permutation A[1], A[2], ..., A[N] of numbers 1, 2, ...,N.
He calls a permutation A good, if the number of its inversions is equal to the n...
分类:
其他好文 时间:
2014-05-07 07:20:50
阅读次数:
356
Action代码: public function index(){
$prod = I("get.prod_en");
$id = I("get.id", 0, "int");
if ($prod == ""){
$serviceProduct = array();//多重循环遍历的数组 //数据保存在两张表中,这里通过循环初始化$serviceProduct数组...
分类:
Web程序 时间:
2014-05-07 07:13:02
阅读次数:
440
Android-自定义meta-data扩展数据2014年5月5日 在接入第三方渠道SDK的时候,经常会看到其配置文件AndroidManifest.xml有类似如下的定义:
<meta-data
android:name="APP_ID"
android:value="037810BCE1D2260F32017643AC7D980...
分类:
移动开发 时间:
2014-05-07 06:50:16
阅读次数:
495
1、当你的自增id主键很大时,你想让id重新到1开始自增 请输入: truncate
table 表名;
2、当你的数据库损坏时,你别慌先试试这条命令是否可以帮助你 请输入: repair table 表1,表2…
3、当你的数据表中含有varchar、text等并进行多次删除添加等操作,
会产生好多碎片空间,这回浪费资源,需要进行...
分类:
数据库 时间:
2014-05-07 05:40:59
阅读次数:
426
Subtraction Game 1
Chef is playing a game on a sequence of N positive integers, say A1, A2, ... AN. The game is played as follows.
If all the numbers are equal, the game ends.Otherwise
Sele...
分类:
其他好文 时间:
2014-05-07 03:14:01
阅读次数:
280
--oracle实现自增id
--创建一张T_StudentInfo表
create table T_StudentInfo
(
"id" integer not null primary key,
xsName nvarchar2(120) not null,
xsAge integer not null,
Mobile varchar(...
分类:
数据库 时间:
2014-05-06 15:04:22
阅读次数:
525