Path Sum IIGiven a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tr...
分类:
其他好文 时间:
2014-07-31 23:17:10
阅读次数:
175
题目:Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree and ....
分类:
编程语言 时间:
2014-07-31 05:22:15
阅读次数:
287
题目意思:给一棵树,找到俩个不相交的通路,使得这俩个通路的长度和乘机最大;解法: 小哥一看呵呵 这不就是枚举点 然后求俩边的树的直径在相乘求个最大值的题么! 呵呵 这个N 有100000 当时就不玩了; 学长指导了下我; 俺会了!/灯泡 在枚举点在书的直径上时点的左右的最长的链无非这几...
分类:
其他好文 时间:
2014-07-30 12:07:53
阅读次数:
342
新建的一个项目中,出现编译错误,发现是缺少了libxml2.dylib,后面将这个资源包添加了,编译还是出现标题上所说的问题 解决办法: 在Header Search Paths下的Debug和release下添加下面的设置 ${SDKROOT}/usr/inc...
分类:
移动开发 时间:
2014-07-29 18:27:52
阅读次数:
231
/*
ID: lucien23
PROG: preface
LANG: C++
*/
#include
#include
#include
#include
using namespace std;
int main()
{
ifstream infile("preface.in");
ofstream outfile("preface.out");
if(!infile || ...
分类:
其他好文 时间:
2014-07-29 14:54:28
阅读次数:
177
1.实例化FMDatabase//paths: ios下Document路径,Document为ios中可读写的文件夹NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask,...
分类:
数据库 时间:
2014-07-29 11:09:56
阅读次数:
281
#pragma warning(disable:4996)
#include <cstdio>
#include <Windows.h>
#include <tchar.h>
/*
submit time : 3
1. Time Limit Exceeded
23, 12
request :
A robot is located at the top-left corn...
分类:
其他好文 时间:
2014-07-25 11:40:41
阅读次数:
315
解题报告
求最长路。
用SPFA求最长路,初始化图为零,dis数组也为零
#include
#include
#include
#include
#include
#define inf 99999999
#define N 110
using namespace std;
int mmap[N][N],dis[N],vis[N],n;
void spfa(int s)
{
...
分类:
其他好文 时间:
2014-07-24 17:43:16
阅读次数:
280
这题在Unique Paths的基础上增加了一些obstacle的位置,应该说增加的难度不大,但是写的时候对细节的要求多了很多,比如,第一列的初始化会受到之前行的第一列的结果的制约。另外对第一行的初始化,也要分if else赋值。很容易出现初始化不正确的情况。 代码: class Solut...
分类:
其他好文 时间:
2014-07-24 05:06:08
阅读次数:
221
做法:
1、在同一目录下,备份一份;
2、在备份的目录下update下;
3、在步骤2没有问题的前提下,删除原先的文件夹(文件);
4、修改下备份的文件夹的名称,改为原先的;
至此,一切OK~...