静态字典树。 1 #include 2 #include 3 #include 4 5 #define MAXN 10005 6 7 typedef struct Trie { 8 bool v; 9 Trie *next[10];10 Trie() {11 ...
分类:
其他好文 时间:
2014-06-28 09:39:33
阅读次数:
171
对一个数组,将数组中偶数从大到小排序,奇数从小到大排序,奇数和偶数交叉着放且输出数组第一位放奇数,若奇数和偶数不等长,则把剩下的直接放到数组中。#include#include#includeusing namespace std; bool cmp(int &a,int &b){ return ....
分类:
其他好文 时间:
2014-06-28 09:37:42
阅读次数:
127
#include#include#include#include#includeusing namespace std;#define N 510000struct P{ int x,y; P(int a=0,int b=0){x=a,y=b;} bool operator=k)retu...
分类:
其他好文 时间:
2014-06-28 09:30:59
阅读次数:
148
1 DX中的创建字体的函数
HRESULT D3DXCreateFont(
__in LPDIRECT3DDEVICE9 pDevice,
__in INT Height,
__in UINT Width,
__in UINT Weight,
__in UINT MipLevels,
__in BOOL Italic,
__in DWO...
分类:
其他好文 时间:
2014-06-28 09:26:30
阅读次数:
226
如果界面上有多个按钮的话,当你同时点击这几个按钮,会同时出发多个方法,再如果你的action进行了界面跳转,则会出现一个bug,你不信的话,可以试试。。。
之前有想过解决方法,第一种就是设置一个全局变量,当点击的时候将bool值设置为yes,在方法的最后再设置回来,这样的话是一件非常麻烦的事情;后来发现苹果对此已经有相关的解决方案:[btn setExclusiveTouch:YES];...
分类:
移动开发 时间:
2014-06-28 09:14:48
阅读次数:
208
CWnd::Attach
Attaches a Windows window to a CWnd object.
BOOL Attach(
HWND hWndNew
);
Parameters
hWndNew
Specifies a handle to a Windows window.
一个概念:C++对象和Windows对象的区别(来自MSDN)
The win...
分类:
其他好文 时间:
2014-06-28 08:04:10
阅读次数:
269
基本数据类型 所占用空间大小byte b; 1字节short s; 2字节int i; 4字节long l; 8字节char c; 2字节(C语言中是1字节)float f; 4字节double d; 8字节boolean bool; false/true 1字节基本数据类型注意事项:1、未带有字符...
分类:
编程语言 时间:
2014-06-27 22:49:11
阅读次数:
383
题目大意:
分析长度为n的子串有多少种。
思路分析:
对于没出现的字符,将其分配一个数字。
然后将子串看做一个nc进制的数。
然后hash判断。
#include
#include
#include
#include
#include
#include
using namespace std;
bool vis[26666666];
int val[30...
分类:
其他好文 时间:
2014-06-27 09:45:35
阅读次数:
184
遇到这样一个需求:应用无论处于哪个view controller,摇动手机,都能够出发某一方法。
能够想到的思路就是用苹果封装好的“MotionEvent”,但是如果简单的把一下代码加到某一view controller中,那么只有在该view controller展示在前端时,摇动手机才会出发方法。
- (BOOL)canBecomeFirstResponder {//默认是NO,所以得重写...
分类:
移动开发 时间:
2014-06-27 08:00:42
阅读次数:
212
1、定义一个事件:
-(IBAction)limitLength:(UITextField *)sender
{
bool isChinese;//判断当前输入法是否是中文
if ([[[UITextInputMode currentInputMode] primaryLanguage] isEqualToString: @"en-US"]) {
isChines...
分类:
移动开发 时间:
2014-06-27 07:40:38
阅读次数:
177