Visitors hit counter dreamweaver
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 26 下一页
摘要: #include<iostream>using namespace std;int father[50005];int rank[50005];int maxNum;void make_set(int x){ father[x]=x; rank[x]=1;}int find_set(int x){ if(x!=father[x]) { father[x]=find_set(father[x]); } return father[x];}void Union(int x,int y){ x=find_set(x); y=... 阅读全文
posted @ 2012-01-19 16:10 Jason Damon 阅读(186) 评论(0) 推荐(0) 编辑
摘要: Aptana作为一款新兴的,简单易用的JavaScript调试工具,目前尚有一些小问题。某日在学校用DW写好的html带回家,用Aptana打开,中文全部变成小格子- -!经过多方寻求,仍然没找到答案。网上的帖子,普遍是教你把Window->Preferences->ContentTypes->Text的DefaultEncoding改为UTF-8,然后UPDATE一下。这样做只是保证你新建的文件和编码没有问题,但不能解决打开文件时是乱码的问题。如果把DefaultEncoding改为GBK,GB2312等,按说可以正常打开文件了,可是偏偏此软件不支持此编码,报错后经过半天折 阅读全文
posted @ 2011-12-16 21:46 Jason Damon 阅读(586) 评论(0) 推荐(0) 编辑
摘要: POJ 1611学了并查集后 这个就很easy啦~#include <iostream>using namespace std;int m,n,first;int father[30005],num[30005];void makeSet(int n){ for(int i=0;i<n;i++){ father[i]=i; num[i]=1; }}int findSet(int x){ if(father[x]!=x){ father[x]=findSet(father[x]); } return father[x];}void U... 阅读全文
posted @ 2011-12-16 00:50 Jason Damon 阅读(242) 评论(0) 推荐(1) 编辑
摘要: POJ1308并查集的学习#include <iostream>#include <memory.h>using namespace std;int father[5000];bool has_point[5000];int case_number;void Ini_Set(int y){ father[y]=y; has_point[y]=true;}int Find_Set(int x){ if(father[x]!=x){ //不是单独的节点 father[x]=Find_Set(father[x]); } return father[x]... 阅读全文
posted @ 2011-12-14 10:28 Jason Damon 阅读(330) 评论(0) 推荐(0) 编辑
摘要: 直接上代码:#include <stdio.h>#include <stdlib.h>#include <string.h>#include <memory.h>#include <iostream>#include <queue>using namespace std;//图的数组(邻接矩阵)存储#define INFINITY INT_MAX //用整型最大值#define MAX_VERTEX_NUM 20 //最大顶点个数 //顶点关系,对无权图,用1(是)或0(否)表示相邻否bool visited[20];ty 阅读全文
posted @ 2011-12-08 11:37 Jason Damon 阅读(1858) 评论(0) 推荐(0) 编辑
摘要: 为了不直接以标志位的方式去处理流的状态, c++标准库提供了标准的操作符函数专门操控这些状态。 这组函数不属于任何类成员,定义在iomanip头文件中。 将它们用在提取运算符“>>”或插入运算符“<<”后面来设定输入/输出格式,即在读写对象之间插入一个修改状态的操作。 其中有些函数没有参数,所以又叫操作符。#include <iostream>#include <iomanip>using namespace std;int main(){ char *p="12345",*q="678"; char f[ 阅读全文
posted @ 2011-12-07 10:36 Jason Damon 阅读(789) 评论(0) 推荐(0) 编辑
摘要: 最近心有点浮躁。刚考完一科计算机网络,新手机到,玩新手机,刷手机系统,重装电脑系统,费了好多的时间。也有好几点不敲代码了。不行啊!这样没前途的哦,亲~赶紧的调整状态。马上!必须要inner peace。什么是inner peace呢?Inner peace (or peace of mind) refers to a state of being mentally and spiritually at peace, with enough knowledge and understanding to keep oneself strong in the face of discord or . 阅读全文
posted @ 2011-12-05 00:38 Jason Damon 阅读(333) 评论(0) 推荐(0) 编辑
摘要: N个人排成一圈,按顺时针从1到N编号。从1开始顺时针数到第k个人,让其出圈,接着数到第k个人,让他站在出圈者的位置上。然后从出圈者的后继位置开始数,重复上述过程直到环中只剩1个人。当N=5,k=2时,出环者的顺序为:2,5,3,1;最后留下4。 输入:N,k 输出:I,使得从第I个人开始数,最后能留下第1人。分析: n当N=5,k=2时 从1开始数,留下4; 从2开始数,留下5; 从3开始数,留下1; 因此,输入5、2时,按照要求,应输出3 n一般的情况: 从1开始数,留下i; 从2开始数,留下i+1; … 从n-i+1开始数,留下i+ (n-i+1) -1 = n; 从n-i+2开始数,留. 阅读全文
posted @ 2011-12-05 00:31 Jason Damon 阅读(537) 评论(0) 推荐(0) 编辑
摘要: 创建一个空的XML文档:var XML={};XML.newDocument=function(rootTagname,namespaceURL){ if(!rootTagname) rootTagname=""; if(!namespaceURL) namespaceURL=""; if(document.implementation && document.implementation.createDocument){ //This is the W3C standard way to do it return document.im 阅读全文
posted @ 2011-12-01 12:49 Jason Damon 阅读(246) 评论(0) 推荐(0) 编辑
摘要: 最近状态不是很好,吃饭吃不下,中午睡觉也睡不着。为什么呢?这到底是为什么呢??!找了好久,终于把问题的根源找出来了。因为上周开始我要给大二的讲数据结构的课,而我也是边学边给他们教的,我老怕自己教不好他们,所以老惦记着要好好备课。争取做得最好。但是,自己又不想去备课那么早,于是,这个担心就一直萦绕在我的心头,挥子不去啊。害得我这一周来都有点。。不在状态。再加上这周三要考计算机网络了,又要忙着复习呢。就这两个事,就把自己弄得乱糟糟的。HXJ呀HXJ,你说你是怎么了?就这点是也难得倒你么?振作起来! 找到了问题根源之后,我今天马上把我这周末要讲的课的内容准备好了,就这样,心里豁然开朗,舒服多了。.. 阅读全文
posted @ 2011-11-29 00:50 Jason Damon 阅读(266) 评论(0) 推荐(0) 编辑
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 26 下一页