Given an array of integers, find two numbers such that they add up to a specific target number.
The function twoSum should return indices of the two numbers such that they add up to the target, whe...
分类:
其他好文 时间:
2014-06-09 23:14:45
阅读次数:
264
I=imread(im_path);
axes(handles.axes1);
imshow(I),
% title('原始图像');
%计算每个像素点的真实长度
[x,y]=ginput(2);
length=str2double(get(handles.edit5,'st...
分类:
其他好文 时间:
2014-06-08 18:11:31
阅读次数:
263
【题目】
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.
For example, given the following triangle
[
[2],
[3,4],
[6,5,7],
[4,1,8,3]
]
The minimum path sum from top to...
分类:
其他好文 时间:
2014-06-08 17:52:45
阅读次数:
235
Find the contiguous subarray within an array (containing at least one number) which has the largest sum....
分类:
其他好文 时间:
2014-06-08 15:54:08
阅读次数:
258
本题有两个考点:
1 求逆序数的性质
计算逆序数的公式, 一个数arr[i]从前面放到后面,必然会有n-arr[i]-1个数比这个大,那么就有n-arr[i]-1个逆序数增加,同时因为前面少了个arr[i]数,那么就必然有arr[i]个(加上零)数比起小的数失去一个逆序数,总共失去arr[i]个逆序数,所以新的逆序数为增加了n-arr[i]-1-arr[i]个逆序数(当然有可能是减小了,视ar...
分类:
其他好文 时间:
2014-06-08 15:52:20
阅读次数:
275
题目来源:Light OJ 1278 Sum of Consecutive Integers
题意:N拆分成连续整数和的方案数
思路:奇因数的个数
#include
#include
#include
#include
using namespace std;
//筛素数
const int maxn = 10000010;
bool vis[maxn];
int prime[10...
分类:
其他好文 时间:
2014-06-08 15:34:09
阅读次数:
295
看了韩顺平的j2ee的视频后,吧里面教的做了出来,感觉好极了,新手上路!!!
这个肯定不是原创,但是也不是转载,那我就姑且把它作为翻译吧,给其他看视频学习但是没有代码的同学一点福利吧
首先是login.jsp的登陆界面代码。
<%
String path = request.getContextPath();
String basePath = request.getScheme()+":...
分类:
Web程序 时间:
2014-06-08 10:47:14
阅读次数:
258
const int maxn = 100010;
int n, m;
vector G[maxn*2];
bool mark[maxn*2];
int S[maxn*2], c;
int a[maxn], b[maxn], sum;
bool dfs(int x)
{
if(mark[x^1])
return false;
if(mark[x])
return true;
mark...
分类:
其他好文 时间:
2014-06-08 10:31:01
阅读次数:
198
题目
Given a binary tree, find its maximum depth.
The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
方法
使用DFS对树进行遍...
分类:
其他好文 时间:
2014-06-08 10:26:33
阅读次数:
207
PWD和OLDPWDPWD代表当前工作目录,改变目录后系统会自动更新该环境变量OLDPWD代表之前的工作目录实验:先进入/home目录,再cd到/etc目录,查看这两个变量
PATH这个环境变量大家应该比较熟悉,可执行文件的搜索路径,避免每次都要写全路径或者相对路径。默认多个可执行文件路径以冒号分隔...
分类:
系统相关 时间:
2014-06-07 21:01:53
阅读次数:
563