l问题描述:有一块N*N的玉米田(N 2 #include 3 #include 4 5 using namespace std; 6 7 int field[52][52]; 8 int N,K; 9 10 struct Node{11 int x,y,r;12 }node[11];1...
分类:
其他好文 时间:
2014-07-22 22:46:15
阅读次数:
216
我们经常用简单数据类型,比如int作为泛型Dictionary的key,但有时候我们希望自定义数据类型作为Dictionary的key,如何做到? 如果我们想自定义一个struct类型作为key,就必须针对该struct定义一个实现IEqualityComparer接口的比较类,实现该接口的2个方法...
分类:
其他好文 时间:
2014-07-22 22:40:14
阅读次数:
262
拓扑排序。
反向建边。
为了序号小的尽量在前面,我们每次都取出入度为0的最大的点。
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
struct list
{
int u,v,w;
int next;
}edge[110000];
int ...
分类:
其他好文 时间:
2014-07-22 22:38:54
阅读次数:
265
- (NSString*)deviceString{ // 需要#import "sys/utsname.h" struct utsname systemInfo; uname(&systemInfo); NSString *deviceString = [NSString ...
分类:
移动开发 时间:
2014-07-22 22:35:55
阅读次数:
165
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { struct XYZ { ...
分类:
其他好文 时间:
2014-07-22 22:34:55
阅读次数:
208
直接代码、、、
#include
#include
#include
#include
#include
using namespace std;
struct node
{
int fuel,dist;
//bool operator d.dist;
// }
}s[10005];
...
分类:
其他好文 时间:
2014-07-22 22:34:14
阅读次数:
178
产生RST的三个条件:
1. 目的地为某端口的SYN到达,然而该端口上没有正在监听的服务器;
2. TCP想取消一个已有的连接;
3. TCP接收到一个根本不存在的连接上的分节;
现在模拟上面的三种情况:
client:
struct sockaddr_in serverAdd;
bzero(&serverAdd, sizeof(serverAdd));...
分类:
其他好文 时间:
2014-07-22 17:57:21
阅读次数:
333
避免含糊转换
参数匹配和相互转换
struct B;
struct A
{
A()=default;
A(const B&) //吧B负责给A,拷贝构造函数
{//嘿,这里我有点明白了,只要 后面调用了这个函数,那么这个函数就得有定义
//不能只声明不定义
cout<<"调用了A(const B&)转换!"<<endl;
}...
分类:
编程语言 时间:
2014-07-22 14:43:26
阅读次数:
297
题目:hdoj1754 I Hate It
分析:更新的话,建树的时候保存叶子编号的的节点信息,然后从下往上更新就ok。
求和的话,从根节点开始,然后找在根的左边还是右边,然后递归找一个所有中的最大值即可、
代码:
#include
#include
#include
using namespace std;
const int N = 205000;
struct...
分类:
其他好文 时间:
2014-07-22 14:33:36
阅读次数:
179
//1、这一章的习题纯粹为了刷存在感。。。
typedef struct phone
{
char * quhao;
char * jiaohuantai;
char * zhanhaoma;
};
typedef struct call
{
char * date;
char * time;
phone * shiyong;
phone * self;
phone * huji...
分类:
其他好文 时间:
2014-07-21 23:16:53
阅读次数:
177