由于二维字符数组的第二维没有赋值运算符,即不能对整个一维数组进行赋值,因此是无法直接对二维数组用sort进行排序的,解决办法有二种:代码一: 1 #include 2 #include 3 #include 4 using namespace std; 5 6 struct Data 7 {...
分类:
其他好文 时间:
2014-08-24 11:35:52
阅读次数:
125
一、内核定时器定义:struct timer_list { struct list_head entry; unsigned long expires; void (*function)(unsigned long); unsigned long data; struc...
分类:
系统相关 时间:
2014-08-24 11:30:02
阅读次数:
241
解题报告
思路:
spfa判负环。
#include
#include
#include
#include
#define inf 0x3f3f3f3f
#define N 40000
#define M 100000
using namespace std;
struct node {
int v,w,next;
} edge[M];
int head[N],dis[N],...
分类:
其他好文 时间:
2014-08-23 20:25:41
阅读次数:
261
解题报告
题目传送门
思路:
bfs建图跑一下费用流就行。
#include
#include
#include
#include
#define inf 0x3f3f3f3f
using namespace std;
struct E {
int v,cost,cap,next;
} edge[100000];
int head[1000],cnt,dis[1000],...
分类:
其他好文 时间:
2014-08-23 19:07:51
阅读次数:
243
解题报告
思路:
裸裸的最短路。
#include
#include
#include
#include
#define inf 0x3f3f3f3f
#define N 40000
#define M 100000
using namespace std;
struct node
{
int v,w,next;
}edge[M];
int head[N],dis[N],vi...
分类:
其他好文 时间:
2014-08-23 19:05:51
阅读次数:
162
解题报告
题目传送门
思路:
简单的差分约束
求解max
n-1
以1为起点,n为终点跑一下最短路就可以了,求出的dis[n]就是答案
#include
#include
#include
#include
#define N 5000
#define M 50000
#define inf 0x3f3f3f3f
using namespace std;
struct nod...
分类:
其他好文 时间:
2014-08-23 19:05:21
阅读次数:
255
#define N100000有了这样的定义后,在程序中使用N就代表100000typedef int word4给int取个新名字word4(转)struct和typedef struct的 区别分三块来讲述: 1 首先://注意在C和C++里不同 在C中定义一个结构体类型要用typede...
分类:
其他好文 时间:
2014-08-23 18:57:01
阅读次数:
192
//求两圆相交的面积#include#include#include#include#include#include#define esp 1e-8using namespace std;struct Circle{ double x,y; double r;};double calAr...
分类:
其他好文 时间:
2014-08-23 18:55:31
阅读次数:
276
和hdu2222题相似的水题
提示:
1)连着RE了好多发,没想明白,看了一下网上题解才知道,输入的不一定都是字母,所以next要开100!!!!!!!
#include
#include
int tot;
char str[10005];
int t;
//int time[100];
struct trie {
trie *fail;
trie *next[100];...
分类:
其他好文 时间:
2014-08-23 16:53:36
阅读次数:
279
/*
很明显的最大权闭合图题
*/
#include
#include
#include
using namespace std;
#define N 2100
#define inf 0x3fffffff
struct node {
int u,v,w,next;
}bian[N*N*20];
int head[N],yong,dis[N],work[N];
void init(){
yong=...
分类:
其他好文 时间:
2014-08-23 16:51:11
阅读次数:
251