书山有径勤为路>>>>>>>>

<<<<<<<<学海无涯苦作舟!

上一页 1 2 3 4 5 6 ··· 19 下一页

2012年5月21日

MFC中的基本知识

摘要: 阅读全文

posted @ 2012-05-21 21:13 More study needed. 阅读(174) 评论(0) 推荐(0) 编辑

2012年5月20日

线性探查法

摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=1496这个方法好快哦。View Code #include "iostream"#include "string"using namespace std;#define MAX 40000typedef struct hash{ int key; //乘积 int num; //乘积个数}hash;hash h[MAX];int Line(int k){ //线性探查法 int d = k%MAX; if(d<0){ d+=MAX; } while(h[.. 阅读全文

posted @ 2012-05-20 19:33 More study needed. 阅读(1711) 评论(0) 推荐(0) 编辑

2012年5月18日

如何计算三点面积

摘要: 题目:http://acm.swust.edu.cn/oj/problem/848/代码:View Code #include "stdio.h"#include "string.h"#include "stdlib.h"#include "math.h"#include "iostream"#include "ctime"using namespace std;typedef struct node{ double x, y;}node;double Cal_Area(no 阅读全文

posted @ 2012-05-18 22:37 More study needed. 阅读(422) 评论(0) 推荐(0) 编辑

2012年5月16日

如何在终端查看系统运行了多长时间

摘要: 输入uptime就可以了。显示的内容依次为:现在系统时间/系统运行了多长时间/目前有多少个用户/系统在过去的1分钟,5分钟,15分钟的平均负载。 阅读全文

posted @ 2012-05-16 13:47 More study needed. 阅读(200) 评论(0) 推荐(0) 编辑

如何在终端查看内存的使用情况

摘要: 使用free -g 以G为单位free -m 以M为单位free -b 以B为单位来查看内存的使用情况。 阅读全文

posted @ 2012-05-16 13:44 More study needed. 阅读(363) 评论(0) 推荐(0) 编辑

如何获得相关指令的详细信息

摘要: 1.使用man命令可以找到特定的联机帮助面,并白日提供简短的命令说明。使用man命令的语法格式为:man command_name比如我们要查看shutdown命令的详细信息。应该这样输入man shutdown2.使用info在一定的情况下也是可以的。用法和man一样。 阅读全文

posted @ 2012-05-16 13:31 More study needed. 阅读(146) 评论(0) 推荐(0) 编辑

2012年5月13日

输入的最小按键次数

摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=2577用动态规划角。on[i]表示在lock为开的时候输入第i个字符时的最小按键次数。off[i]表示在lock为关的时候输入第i个字符时的最小按键次数。View Code #include "iostream"#include "string"using namespace std;#define MAX 105int on[MAX], off[MAX];int main(){ int n; string str; cin>>n; while(n-- 阅读全文

posted @ 2012-05-13 23:03 More study needed. 阅读(325) 评论(0) 推荐(0) 编辑

2012年5月9日

滚动数组的简单应用

摘要: 题目:http://acm.swust.edu.cn/oj/problem/324/View Code //1.动态范围//2.动态次数//3.动态规律//4.动态边界#include <stdio.h>#include<string.h>int main(){ int Live, Stand, Step; int f[101][2]; while(scanf("%d%d%d", &Live, &Step, &Stand)!=EOF){ memset(f, 0, sizeof(f)); f[Stand][0] = 1; int 阅读全文

posted @ 2012-05-09 23:47 More study needed. 阅读(161) 评论(0) 推荐(0) 编辑

对滚动数组的理解

摘要: 滚动数组的作用在于优化空间,主要用在递推和动态规划中。因为dp题目是一个自底向上扩展过程,我们常常需要用到的是连续的解,前面的解往往可以舍去。所以用滚动数组优化是很有效的。利用滚动数组的话在N很大的情况下可以达到压缩存储的作用。滚动数组实际是一种节省空间的办法,时间上没啥优势,多用于dp.其实用一维的数组来进行的简单背包就是用了滚动数组啊。 阅读全文

posted @ 2012-05-09 22:16 More study needed. 阅读(246) 评论(0) 推荐(0) 编辑

2012年5月8日

链表参数的引用与非引用

摘要: 今天做了一个简单的题目。但是,我发现,在传参数的时候,如果不使用引用传参,那么头指针就会随着tmp指针向后移动。如果使用引用传参的话,它就不会了。题目:http://acm.swust.edu.cn/oj/problem/172/View Code #include<stdio.h>#include<stdlib.h>#include<string.h>typedef struct node{ int n; struct node *next;}node;node *A, *B, *ta, *tb, *p;void Init_AB(){ A = (node* 阅读全文

posted @ 2012-05-08 22:50 More study needed. 阅读(500) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 ··· 19 下一页

导航

书山有径勤为路>>>>>>>>

<<<<<<<<学海无涯苦作舟!