异常处理
一、预定义异常:
Dup_val_on_index:试图向唯一索引列插入重复值,相当于建立了一个唯一索引 然后再向这个索引的列中插入一条重复的数据就会异常。
Invalid_cursors:试图进行非法的游标操作
Invalid_number : 试图将字符串转换为数字
no_data_found : select into 语句没有返回任何记录
Too_many_rows ...
分类:
其他好文 时间:
2014-08-19 09:27:03
阅读次数:
210
LCM (Least Common Multiple) of a set of integers is defined as the minimum number, which is a multiple of all integers of that set. It is interesting to note that any positive integer can be expressed...
分类:
其他好文 时间:
2014-08-18 23:38:13
阅读次数:
275
题目链接:
传送门
思路:
这道题是维基百科上面的记忆化搜索的例题。。。
四维状态dp[maxn][5][2][5]分别表示第几根棒子,这根棒子的高度,是否达到题目的要求和使用不同棒子数,那么接下来就是状态转移了。。。要用到位运算判断以前是否这种高度的棒子用到没。。。那么这个问题就解决了。。。
题目:
Number of Locks
Time Limit:...
分类:
其他好文 时间:
2014-08-18 23:36:33
阅读次数:
264
题目链接
题意:给出n到m的范围,求出一个数在前i位数组成的数字能被i整除,如果存在输出这个数,如果不存在,输出-1.
思路:回溯,每次放第i位,然后判断是否符合题意。这题踩着时间过去的2.6s(看了下别人的题解,可以减少取模次数来节省时间)。
代码:
#include
#include
#include
#include
using namespace ...
分类:
其他好文 时间:
2014-08-18 22:05:53
阅读次数:
303
Edit Distance
Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)
You have the following 3 operati...
分类:
其他好文 时间:
2014-08-18 20:35:02
阅读次数:
206
好几天没写题解了… 都怪我太弱 补题补不动…
HDU 4937 Lucky Number
题意:一个数字如果只有3456这四种数字组成 那么这个数字是幸运的 问 给出一个x 它在几种进制下是幸运的 如果无穷输出-1
思路:
分类讨论 如果x是3或4或5或6 那么一定有无穷个进制满足(从十进制开始…) 直接输出-1
除去上述情况 那么我们可以将一个数字写成这样 a0 +...
分类:
其他好文 时间:
2014-08-18 18:40:02
阅读次数:
243
TOYS
Time Limit: 2000MS Memory Limit: 65536K
Total Submissions: 10425 Accepted: 5002
Description
Calculate the number of toys that land in each bin of a partitioned toy box.
Mom and dad have a...
分类:
其他好文 时间:
2014-08-18 18:38:13
阅读次数:
307
先是想筛法素数表啊,然后1~2000000000枚举打表啊,结果越想越不对。
后来想到唯一分解定理,可是怎么实现呢。。果然还是需要努力啊。。
研究了discuss代码,码之~
~~~~
dp的思想,若dp[i]是Humble Numbers,那么dp[i]*2,dp[i]*3,dp[i]*5,dp[i]*7都将是Humble Numbers。
所以只需要注意连续性便好了。
#inclu...
分类:
其他好文 时间:
2014-08-18 18:32:52
阅读次数:
166
题目如下:
215 = 32768 并且其各位之和为 is 3 + 2 + 7 + 6 + 8 = 26.
21000 的各位数之和是多少?
原题如下:
215 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.
What is the sum of the digits of the number 210...
分类:
编程语言 时间:
2014-08-18 16:28:02
阅读次数:
272
A pair of numbers has a unique LCM but a single number can be the
LCM of more than one possible pairs. Forexample 12 is the
LCM of (1, 12), (2, 12),
(3,4) etc. For a given positive integer N, the ...
分类:
其他好文 时间:
2014-08-18 16:25:24
阅读次数:
240