问题
给定n个数,从中拿走x(x>=0)个数,使剩下的数最有下列性质。
A1 At+1 >At+2 > … > As
问最少要抽掉几个数,此数列才会具有以上性质。
图解
代码
#include "stdafx.h"
const int MAX=105;
int down[MAX],up[MAX];
int h[MAX],n;
void get_up(){
int...
分类:
编程语言 时间:
2014-10-11 19:15:56
阅读次数:
248
触发器中的Inserted和deleted临时表:SQL2000中,inserted表和deleted表用于存放对表中数据行的修改信息。他们是触发器执行时自动创建的,放在内存中,是临时表。当触发器工作完成,它们也被删除。它们是只读表,不能向它们写入内容。inserted表:用来存储INSERT和UP...
分类:
数据库 时间:
2014-10-11 17:57:55
阅读次数:
222
假设出现:nested push animation can result in corrupted navigation barFinishing up a navigation transition in an unexpected state. Navigation Bar subview t...
分类:
其他好文 时间:
2014-10-11 16:43:35
阅读次数:
170
代码中获取getActionbar().getHeight() 这个方法在onCreate中是获取不到高度的,平常使用还可以第二种,通过主题数据获取高度/** * 获取ActionBar 高度 * @param context * @return */ public static ...
分类:
其他好文 时间:
2014-10-11 16:26:45
阅读次数:
189
android组件中的onTouch,onClick,onLongClick事件发生先后顺序和关联:一,onTouch返回false首先是onTouch事件的down事件发生,此时,如果长按,触发onLongClick事件;然后是onTouch事件的up事件发生,up完毕,最后触发onClick事件...
分类:
移动开发 时间:
2014-10-11 11:45:35
阅读次数:
198
Intuitively there must a O(n) solution.First I tried a bottom-up DP solution but it had a TLE:class Solution {public: int maxProduct(int A[], int n...
分类:
其他好文 时间:
2014-10-11 08:50:25
阅读次数:
141
Search in Rotated Sorted Array II
Total Accepted: 18500 Total
Submissions: 59945My Submissions
Follow up for "Search in Rotated Sorted Array":
What if duplicates are allowed?
Would this...
分类:
其他好文 时间:
2014-10-10 21:35:14
阅读次数:
239
使用ActionBar SearchView时的注意点:
首先要吐槽一下Android的官方Guide文档,关于用法讲得不明确,可能是一直没更新的原因吧。
本来照着文档搞了一下,hint死活出不来,也无法跳转到搜索结果Activity。
StackOverflow也有人提出了这个问题,答案说得很明白 -
参考链接。
正确用法
在AndroidManifest.xml中为提供S...
分类:
其他好文 时间:
2014-10-10 21:20:34
阅读次数:
198
Search in Rotated Sorted Array II
Total Accepted: 18488 Total
Submissions: 59914My Submissions
Follow up for "Search in Rotated Sorted Array":
What if duplicates are allowed?
Would this...
分类:
其他好文 时间:
2014-10-10 17:26:24
阅读次数:
122
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 nu...
分类:
其他好文 时间:
2014-10-10 16:26:13
阅读次数:
141