摘要: #include<iostream>#include<algorithm>#include<set>using namespace std;void main(){ typedef multiset<int,less<int> >IntSet; typedef multiset<int,less<int> >::iterator msl_RcIter; IntSet msl; cout<<"请输入数据元素的个数:"; int num,i,num1; cin>>num; 阅读全文
posted @ 2012-12-11 21:20 ♂咱說 ろ算 阅读(214) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>using namespace std;#define INF 0x3f3f3ffconst int MAX_V_NUM=105;int Edges[MAX_V_NUM][MAX_V_NUM];struct Node{ int adjvex;//存储该边依附在U中的顶点 int lowcost;//边的权值,访问标记}closedge[MAX_V_NUM];int prim(int u,int n){ int i,j,k,min,sum=0; for(i=1;i<=n;i++) { closedge[i].adjvex=u; closedg 阅读全文
posted @ 2012-12-07 16:04 ♂咱說 ろ算 阅读(244) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<stack>#include<string>using namespace std;#define maxEdge 0x3f3f3ffconst int MAX_V_NUM=100; //点的最大值int Edges[MAX_V_NUM][MAX_V_NUM];//图的邻接矩阵int indegree[MAX_V_NUM]; //存储各顶点的入度string Vert[MAX_V_NUM]; //顶点信息int TE[MAX_V_NUM]; //顶点的最早开始时间int TL[MAX_V_NUM]; // 阅读全文
posted @ 2012-12-07 16:01 ♂咱說 ろ算 阅读(263) 评论(0) 推荐(0) 编辑
摘要: //全排列#include<iostream>#include<vector>#include<stack>#include<queue>#include<list>#include<set>#include<map>#include<cmath>#include<string>#include<algorithm>using namespace std;void main(){ vector<int>a; int i; for(i=1;i<=3;i++) 阅读全文
posted @ 2012-12-07 15:59 ♂咱說 ろ算 阅读(209) 评论(0) 推荐(0) 编辑
摘要: /*实现运算符加与减的重载设计一个时间类,要求能够在时间类上实行以分钟为单位的加减运算,同时当分钟增或减的变化应体现日期变化。如:2012年11月28日12:10PM 增加12小时后,应变为2012年11月29日00:10AM输入一个未来时间(含日期和时间),计算时间间隔,建立一个倒计时显示的计时器(以秒为单位变化)。如当前时间为2012年12月5日15:40,输入时间为2012年12月6日14:40. 输入一个未来时间(含日期和时间),计算时间间隔,建立一个倒计时显示的计时器(以秒为单位变化)。 如当前时间为2012年12月5日15:40,输入时间为2012年12月6日14:40.*/#in 阅读全文
posted @ 2012-12-07 15:57 ♂咱說 ろ算 阅读(282) 评论(0) 推荐(0) 编辑
摘要: package v;import java.awt.*;import javax.swing.*;import java.awt.event.*;public class change extends JFrame{ public change(){ MessagePanel p=new MessagePanel(); setLayout(new BorderLayout()); add(p); } public static void main(String[] args){ change frame=new change(); frame.setTitle("change mes 阅读全文
posted @ 2012-12-07 15:55 ♂咱說 ろ算 阅读(218) 评论(0) 推荐(0) 编辑
摘要: package v;import java.awt.*;import javax.swing.*;import java.awt.event.*;import java.awt.Image.*;public class shen extends JFrame{ public shen() { add(new moving()); //add(new moving()); } public static void main(String[] args) { // TODO Auto-generated method stub shen frame=new shen(); frame.setTit 阅读全文
posted @ 2012-12-07 15:54 ♂咱說 ろ算 阅读(236) 评论(0) 推荐(0) 编辑
摘要: /* 杭电2011和2012级同学如何加入ACM集训队? 微软招聘信息(主要针对已经有工作经验的) 还是畅通工程Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 16025 Accepted Submission(s): 7250 Problem Description某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达 阅读全文
posted @ 2012-11-27 17:15 ♂咱說 ろ算 阅读(159) 评论(0) 推荐(0) 编辑
摘要: /*http://acm.fzu.edu.cn/problem.php?pid=1056扫雷是Windows自带的游戏。游戏的目标是尽快找到雷区中的所有地雷,而不许踩到地雷。如果方块上的是地雷,将输掉游戏。如果方块上出现数字,则表示在其周围的八个方块中共有多少颗地雷。你的任务是在已知地雷出现位置的情况下,得到各个方块中的数据。*... .... “*”表示有地雷 .*.. “.”表示无地雷 ....经过处理应得到*100 2210 1*10 1110 Input输入有多组数据,每组数据的第一行有两个数字,m,n(0<m,n<100)表示游戏中雷区的范围为m×n。接下来m行 阅读全文
posted @ 2012-11-25 14:14 ♂咱說 ろ算 阅读(274) 评论(0) 推荐(0) 编辑
摘要: /*A triangular number is the number of dots that can be packed in an equilateral triangle with n dots on a side. Here are a few example triangles, with their corresponding triangular numbers:You can easily see that a triangular number is the additive equivalent of a factorial:Tn = kYour team is to w 阅读全文
posted @ 2012-11-25 14:07 ♂咱說 ろ算 阅读(242) 评论(0) 推荐(0) 编辑