【题目】
Given a non-negative number represented as an array of digits, plus one to the number.
The digits are stored such that the most significant digit is at the head of the list.
【题意】
给定一个非负整数,这个表示为一个数字数组。计算这个整数加1后的值。
【思路】
从低位到高位依次相加,注意处理进...
分类:
其他好文 时间:
2014-06-05 01:24:44
阅读次数:
250
12508 - Triangles in the Grid
题目链接
题意:给定一个n?m格子的矩阵,然后给定A,B,问能找到几个面积在A到B之间的三角形。
思路:枚举每一个子矩阵,然后求[0,A]的个数减去[0,B]的个数就是答案,然后对于每个子矩阵个数很好求为(n?r+1)?(m?c+1)。关键在于怎么求每个子矩阵的符合个数。
想了好久,参考别人题解才想出来,分3种情况...
分类:
其他好文 时间:
2014-06-05 01:09:44
阅读次数:
248
【题目】
Validate if a given string is numeric.
Some examples:
"0" => true
" 0.1 " => true
"abc" => false
"1 a" => false
"2e10" => true
Note: It is intended for the problem statement to be ambiguous. You should gather all requirements up front before imple...
分类:
其他好文 时间:
2014-06-04 23:45:09
阅读次数:
388
Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a point K (0 ≤ K ≤ 100,0...
分类:
其他好文 时间:
2014-06-03 05:30:23
阅读次数:
394
1.从键盘上输入5个数,输出最大的、最小的元素以及他们的下标
#include
int main(void)
{
int i, j, k, max, min;
int a[10] = {0};
printf("input number:");
for(i = 0; i
scanf("%d", &a[i]);
max = min = a[0];
j = k = 0;
...
分类:
编程语言 时间:
2014-06-03 02:43:47
阅读次数:
241
OJ题目:click here~~
题目分析:输出第k个素数
贴这么简单的题目,目的不纯洁
用筛法求素数的基本思想是:把从1开始的、某一范围内的正整数从小到大顺序排列, 1不是素数,首先把它筛掉。剩下的数中选择最小的数是素数,然后去掉它的倍数。依次类推,直到筛子为空时结束。如有:
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15...
分类:
其他好文 时间:
2014-06-03 01:31:03
阅读次数:
233
创建主键时,所对应的列如果没有索引,数据库默认会自动创建一个索引;如果对于列有索引,那么创建主键不会再创建索引。这里要注意,列值必须满足主键的要求(唯一,非空),简单测试如下:
SQL> create table wxlun_pri(a number);
Table created.
SQL> alter table wxlun_pri add constraint PR...
分类:
其他好文 时间:
2014-06-03 01:03:46
阅读次数:
208
1、错误描述
freemarker基本数据类型
张三丰
123,456
Error on line 20, column 8 in type.ftl
Expecting a string, date or number here, Expression flag is instead...
分类:
其他好文 时间:
2014-06-03 00:51:06
阅读次数:
400
freemarker基本数据类型
1、基本数据类型
(1)字符串
(2)数字
(3)布尔值
(4)日期
2、展示示例
freemarker基本数据类型
${str}
${number}...
分类:
其他好文 时间:
2014-06-02 22:42:44
阅读次数:
233
1、高级函数 1.1 安全的类型检测 typeof 操作符,对一个值使用可能返回下列某个字符串
undefined, boolean, string, number, object, function null 也返回 ob...
分类:
Web程序 时间:
2014-05-31 19:19:18
阅读次数:
361