Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.
For example:
Given the below binary tree and sum ...
分类:
其他好文 时间:
2014-10-06 01:23:59
阅读次数:
228
HDU 4052 Adding New Machine(矩形面积并)
题目大意:
w*h的格子,现在有n个矩形上已经摆放了东西,现在你要放一个东西长度为m,问你有多少种方法?
解题思路:
枚举没用的情况,如果东西横着放
(1)如果碰到障碍物,也就是如果 某个东西占着Xi1,Yi1,Xi2,Yi2,那么max(xi1+1-m,0) , x2 y1y2这片矩形区域就不能放东西。
(2)还有就是被墙当着,也就是max(0,w+1-m),w,0,h这片矩形区域就不能放东西。
...
分类:
其他好文 时间:
2014-10-04 21:46:27
阅读次数:
229
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.
For example:
Given the below binary tree and sum
...
分类:
其他好文 时间:
2014-10-02 18:26:13
阅读次数:
174
/** Android开发之PopupWindow** Created on: 2011-8-8* Author: blueeagle* Email: liujiaxiang@gmail.com*/ 聪明的人善于总结,记录,不知道这是谁说的了,反正要当一个聪明人,我得先学会总结,记录。最近在Andr...
分类:
移动开发 时间:
2014-09-26 13:22:08
阅读次数:
321
Let us consider sets of positive integers less than or equal to n. Note that all elements of a set are
different. Also note that the order of elements doesnt matter, that is, both {3, 5, 9} and {5, 9...
分类:
其他好文 时间:
2014-09-26 02:35:48
阅读次数:
191
使用VS2005以上版本(VS2005、VS2008、VS2010.....)编译在其他编译器下正常通过的C语言程序,你可能会遇到类似如下的警告提示:引用内容warning C4996: 'strcpy': This function or variable may be unsafe. Consi...
分类:
其他好文 时间:
2014-09-24 01:59:05
阅读次数:
172
TextView、EditText、密码EditText、RadioButton、Button、Spinner、CheckBox、ToggleButton
1、工程目录
2、Test_changyongzujian.java
package com.example.test_changyongzujian;
import android.os.Bundle;
import andr...
分类:
移动开发 时间:
2014-09-23 13:46:34
阅读次数:
268
IntroductionEven Chris created his article ofUseful Reference Booksages ago I just bumped into it, and after adding my bit I thought to do something s...
分类:
其他好文 时间:
2014-09-22 23:30:33
阅读次数:
346
[root@testdb11b ~]# /u01/app/oraInventory/orainstRoot.sh Changing permissions of /u01/app/oraInventory.Adding read,write permissions for group.Removin...
分类:
数据库 时间:
2014-09-19 00:59:02
阅读次数:
363
SMSReceiver.java 1 package com.gbg.mybroadcastreceiver; 2 3 import android.content.BroadcastReceiver; 4 import android.content.Context; 5 import andr....
分类:
移动开发 时间:
2014-09-18 11:00:23
阅读次数:
229