日期与时间
struct tm {
int tm_sec; /* 秒 – 取值区间为[0,59] */
int tm_min; /* 分 - 取值区间为[0,59] */
int tm_hour; /* 时 - 取值区间为[0,23] */
int tm_mday; /* 一个月中的日期...
分类:
其他好文 时间:
2014-07-22 23:03:55
阅读次数:
279
1 #include 2 #include 3 #include 4 #define
INIT_STACK_SIZE 100 5 typedef struct 6 { 7 char * chOperator; 8 int dwtop; 9
}OPND;10 11 void I...
分类:
其他好文 时间:
2014-05-01 20:37:37
阅读次数:
373
题意:多维的曼哈顿最远距离
思路:做了1,2,3维的,其实就是枚举所有绝对值的可能的表达式
#include
#include
#include
#include
using namespace std;
const int MAXN = 100005;
const int M = 5;
const double inf = 1e200;
struct node{
double x...
分类:
其他好文 时间:
2014-05-01 17:31:01
阅读次数:
283
题目:寻找最长上升自序列。
代码:
#include
#include
#include
#include
using namespace std;
struct node
{
int w,s; //重量,速度
int num; //编号
int t; //用来记录当前编号...
分类:
其他好文 时间:
2014-05-01 17:17:32
阅读次数:
285
0长度的数组在ISO C和C++的规格说明书中是不允许的,但是由于gcc 预先支持C99的这种玩法,所以,“零长度数组”在gcc环境下是合法的。
先看下面两个例子。
pzeroLengthArray.c
#include
struct str
{
int len;
char *s;
};
struct foo
{
struct str *a;
};
int main()
{...
分类:
其他好文 时间:
2014-04-30 22:22:39
阅读次数:
300
代码:
if((server_fd = accept(sockfd,(struct sockaddr *)&server_addr, &sin_size)) == -1)
{
fprintf(stderr, "Accept error:%s\n\a", strerror(errno));
exit(1);...
分类:
其他好文 时间:
2014-04-30 22:21:38
阅读次数:
765
题目链接:617 - Nonstop Travel
题意:给定一些红绿灯,现在速度能在30-60km/h之内,求多少个速度满足一路不遇到红灯。
思路:暴力每一个速度,去判断可不可以,最后注意下输出格式即可
代码:
#include
#include
#include
const double esp = 1e-6;
int n, vis[105];
struct D {
do...
分类:
其他好文 时间:
2014-04-29 13:45:20
阅读次数:
333
定义了一个elevator_noop的调度器类型:
static struct elevator_type elevator_noop = {
.ops = {
.elevator_merge_req_fn = noop_merged_requests,//查询一个request,用于将bio并入
.elevator_dispatch_fn = noop_dispatch,/...
分类:
系统相关 时间:
2014-04-29 13:33:20
阅读次数:
830
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1588
#include
#include
#include
#include
#include
using namespace std;
#define N 10050
#define M 200005
int n,m;//n个点 m条边
struct Edge{...
分类:
其他好文 时间:
2014-04-29 13:25:21
阅读次数:
383
set容器是以红黑树容器为基础实现的,在其基础上稍加改变接口即可
#ifndef MY_SET_H_INCLUDED
#define MY_SET_H_INCLUDED
#include"my_rb_tree.h"
namespace juine
{
template
struct identity
{
const T& operator()(cons...
分类:
其他好文 时间:
2014-04-29 13:16:20
阅读次数:
376