private Bitmap get_ninepatch(int id,int x, int y, Context context){ // id is a resource id for a valid ninepatch Bitmap bitmap = BitmapFactory.d...
分类:
其他好文 时间:
2015-06-04 18:43:25
阅读次数:
124
【题目】Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: ...
分类:
其他好文 时间:
2015-06-04 17:02:05
阅读次数:
105
Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word.Return all such po...
分类:
编程语言 时间:
2015-06-04 13:34:09
阅读次数:
110
Given a string containing just the characters '(', ')',
'{', '}', '[' and ']', determine if the input string is valid.
The brackets must close in the correct order, "()" and "()[]{}" are all valid b...
分类:
其他好文 时间:
2015-06-03 10:02:51
阅读次数:
141
Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word.
Return all such possible sentences.
For example, given
s = "...
分类:
其他好文 时间:
2015-06-02 18:07:59
阅读次数:
88
1. 执行类public class BooleanConverter implements AttributeConverter {}2. 属性注解@Column(name = "VALID")@Convert(converter = BooleanConverter.class)
分类:
其他好文 时间:
2015-06-02 15:09:28
阅读次数:
447
这道题最大的问题是位置容易想不清楚public class Solution { public int longestValidParentheses(String s) { // http://blog.csdn.net/linhuanmars/article/details/...
分类:
其他好文 时间:
2015-06-02 06:47:55
阅读次数:
124
Validate if a given string is numeric.Some examples:"0" => true" 0.1 " => true"abc" => false"1 a" => false"2e10" => trueNote: It is intended for the p...
分类:
其他好文 时间:
2015-06-01 06:08:57
阅读次数:
113
分析:二分代价,由于序列是单增的,我们使前面一个数相对取最小,这样后面的数变化的值也能相对较小(贪心)。
#include
using namespace std;
#define N 100010
#define max(a,b) ((a)>(b)?(a):(b))
int num[N],tmp[N],n;
bool valid(int cost)
{
int i;
for(i=1;...
分类:
其他好文 时间:
2015-05-31 23:17:24
阅读次数:
140
分析:N和M很小,直接暴力搜索即可。
#include
using namespace std;
#define N 6
#define M 6
int vis[N][M]; //有炮设为2,无炮为0,其他为1
int n,m,q,ans;
#define max(a,b) ((a)>(b)?(a):(b))
bool Valid(int i,int j) //只...
分类:
其他好文 时间:
2015-05-31 12:32:02
阅读次数:
98