题意:两遍最短路链接:点我注意结果用long long 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 #define MOD...
分类:
其他好文 时间:
2015-06-20 11:49:50
阅读次数:
120
要求:将一个指针p传入一个函数f,f的一个参数p1接收此指针,用p1申请p所属类的内存(new),要求亦指向此申请的内存首地址传。
比较下面两段代码,问哪一个能完成任务?为什么?
(1)
using namespace std;
class Matrix{
public:
Matrix(){m_RowCount = 0;};
int getRowCount(){retu...
分类:
其他好文 时间:
2015-06-20 10:39:47
阅读次数:
165
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
const int INF = INT_MAX;
//Edmond Karp.
bool EK_bfs(vector > &G, int src, int dest, vector &Pr...
分类:
编程语言 时间:
2015-06-20 10:35:21
阅读次数:
153
[root@hzswtb2-mpc ~]# mysqlERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)遇到:ERROR 1045 (28000): Access denied for ...
分类:
数据库 时间:
2015-06-20 10:30:45
阅读次数:
137
1.在Model类里面,写好相应的属性。 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Web; 5 using System.Data.Entity; 6 7 nam....
分类:
数据库 时间:
2015-06-20 10:25:36
阅读次数:
225
#include
#include
#include
using namespace std;
#define MAX 100
typedef char VertexType;
typedef struct ArcNode {
int adjvex; //邻接点域,存储该弧指向顶点的下标 (终点)
struct ArcNode *next; //指向下一条...
分类:
其他好文 时间:
2015-06-20 09:16:51
阅读次数:
130
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1201
hint:关键是判断是不是闰年的2月29日!!!#include
#include
using namespace std;
bool run(int year)
{
if(year % 400 ==0 ||(year % 4 ==0 && yea...
分类:
其他好文 时间:
2015-06-20 09:14:08
阅读次数:
148
该题的意思是输入指定数量的字符串,每个字符串的长度一样,找出每个字符串中逆序对,然后按逆序对的升序输出所以的字符串,逆序对相同的则按输入时的顺序输出。
此题的突破点在找逆序对,以下列举两种找出逆序对的方法。
穷举法找逆序对(时间复杂度为O(n^2))
#include
#include
#include
#include
using namespace std;
struct t...
分类:
其他好文 时间:
2015-06-20 09:12:50
阅读次数:
104
#include
using namespace std;template//引用计数的只能指针
class auto_ptr_
{
public:
auto_ptr_(Type *t = NULL):ptr(t), count(1)
{
}
auto_ptr_(const auto_ptr_& at)...
分类:
编程语言 时间:
2015-06-20 09:12:08
阅读次数:
136
bfs,用所给数字由短到长的组成密码,开始用的优先队列,测试了很多数据都没问题,但是交上去却wa,用普通队列重写了一遍才ac
#include
#include
#include
#include
#define maxn 5000+5
using namespace std;
int n,m,z,flag;
int rem[30];
int visit[maxn];
struct stu
{
...
分类:
其他好文 时间:
2015-06-20 09:10:14
阅读次数:
102