2010年12月23日

摘要: #include<stdio.h>#include<stdlib.h>#include<sys/types.h>#include<sys/socket.h>#include<netinet/in.h>#include<arpa/inet.h>#include<netdb.h>char *host_name="127.0.0.1";int port=7778;struct student{ char name[20]; char num[20]; float score;}t={"x 阅读全文
posted @ 2010-12-23 22:16 yming0221 阅读(131) 评论(0) 推荐(0)
摘要: GCC 命令行详解[转帖]1、gcc包含的c/c++编译器gcc、cc、c++、g++gcc和cc是一样的,c++和g++是一样的,一般c程序就用gcc编译,c++程序就用g++编译2、gcc的基本用法gcc test.c这样将编译出一个名为a.out的程序gcc test.c -o test这样将编译出一个名为test的程序-o参数用来指定生成程序的名字3、为什么会出现undefined reference to 'xxxxx'错误?首先这是链接错误,不是编译错误,也就是说如果只有这个错误,说明你的程序源码本身没有问题,是你用编译器编译时参数用得不对,你没有指定链接程序要用到 阅读全文
posted @ 2010-12-23 21:54 yming0221 阅读(269) 评论(0) 推荐(0)
摘要: 本题就是求一个数是否能写成几个数的阶乘的和的形式,可以当作背包问题,也可以用DFS来解,下面用的贪心http://poj.org/problem?id=1775Sum of FactorialsTime Limit:1000MSMemory Limit:30000KDescriptionJohn von Neumann, b. Dec. 28, 1903, d. Feb. 8, 1957, was a Hungarian-American mathematician who made important contributions to the foundations of mathemati 阅读全文
posted @ 2010-12-23 13:38 yming0221 阅读(226) 评论(0) 推荐(0)
摘要: http://poj.org/problem?id=2386简单DFS搜索Lake CountingTime Limit:1000MSMemory Limit:65536KDescriptionDue to recent rains, water has pooled in various places in Farmer John's field, which is represented by a rectangle of N x M (1 <= N <= 100; 1 <= M <= 100) squares. Each square contains e 阅读全文
posted @ 2010-12-23 11:09 yming0221 阅读(140) 评论(0) 推荐(0)
摘要: 刚刚看到我还以为是就是简单排序呢,总是WA然后又使用二进制枚举,不过二进制还不太熟悉,用的将十进制计算转换成二进制,然后计算,总是TLE,记录一下,练习练习位操作最后看到了递归的方法当然本题属于背包问题,可以用DP解决标记,学习了!/* Author : yan * Question : POJ 3628 Bookshelf 2 * Data && Time : Wednesday, December 22 2010 11:34 PM*/#include<stdio.h>int cow[20];int b;int n;int ans=99999999;void DF 阅读全文
posted @ 2010-12-23 07:20 yming0221 阅读(157) 评论(0) 推荐(0)

导航