iddfs入门题。
//poj 3134
//sep9
#include
using namespace std;
int n,deep;
int a[30];
bool iddfs(int pos)
{
int t;
if(pos>deep) return false;
if(a[pos]<<(deep-pos)<n) return false;
if(a[pos]==n) ret...
分类:
其他好文 时间:
2015-04-29 11:38:56
阅读次数:
179
创建一个套接字并将之设置为非阻塞模式:SOCKET s; unsigned long ul = 1; int ret; s = socket(AF_INET, SOCK_STREAM, 0); ret = ioctlsocket(s, FIONRIO, (unsigned long)&ul); i....
分类:
其他好文 时间:
2015-04-29 00:41:29
阅读次数:
135
1、Post提交 private string PostWebRequest(string Url, string paramData, string dataEncode) { string ret = string.Empty; try ...
Spring AOP 用户可能会经常使用executionpointcut designator。执行表达式的格式如下:execution(modifiers-pattern? ret-type-pattern declaring-type-pattern? name-pattern(param-p...
分类:
其他好文 时间:
2015-04-28 20:15:25
阅读次数:
101
Follow up for "Remove Duplicates":What if duplicates are allowed at mosttwice?For example,Given sorted array A =[1,1,1,2,2,3],Your function should ret...
分类:
其他好文 时间:
2015-04-28 18:13:26
阅读次数:
113
void ViewCrystalReport(){Com comapp;Com reporting;str paramwhole;str paramfilename;str paramCond;str ViewYesNo;int ret;COMVariant variant;;variant = n...
分类:
其他好文 时间:
2015-04-27 13:00:34
阅读次数:
134
流行的strcpy函数写法是:[cpp]view plaincopychar*my_strcpy(char*dst,constchar*src){assert(dst!=NULL);assert(src!=NULL);char*ret=dst;while((*dst++=*src++)!='\0')...
分类:
其他好文 时间:
2015-04-26 16:33:34
阅读次数:
147
Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.
For example,
Given:
s1 = "aabcc",
s2 = "dbbca",
When s3 = "aadbbcbcac", return true.
When s3 = "aadbbbaccc", ret...
分类:
其他好文 时间:
2015-04-25 00:20:01
阅读次数:
109
do{...}while(0) 的妙用
1.导引:
第一次见到 do{...}while(0)是在学习libevent的时候,看到里面有很多类似
#define TT_URI(want) do { char *ret = evhttp_uri_join(uri, url_tmp, sizeof(url_tmp)); tt_want(ret != NULL);...
分类:
其他好文 时间:
2015-04-24 19:19:34
阅读次数:
149
为了阐明其作用,我们先来假设有如下一个Person类。
class Person
{
public Person(String name, int age)
{
this.name = name;
this.age = age;
}
private String name;
private int age;
public String getName()
{
ret...
分类:
其他好文 时间:
2015-04-23 23:33:11
阅读次数:
172