一道简单的图论题,不过穿上了很好的外衣,实质就是一个任意两点间最短路问题,比较适合用Floyd算法
#include
#include
using namespace std;
const int INF = 100000;
int n,m,t,d[305][305],a[305];
int main() {
scanf("%d%d",&n,&m);
for(int i=1;i<...
分类:
其他好文 时间:
2015-04-26 18:24:49
阅读次数:
177
#include
#include
#include
using namespace std;
double sumg,sume;
int ga1,gb1,ga2,gb2,ea1,eb1,ea2,eb2;
int main ()
{
while (scanf("%d%d%d%d",&ga1,&gb1,&ga2,&gb2)!=EOF)
{
...
分类:
其他好文 时间:
2015-04-26 18:21:09
阅读次数:
124
#include
#include
#include
using namespace std;
int a[100005];
int dp[100005];
int main()
{
int n;
while(scanf("%d",&n)==1)
{
for(int i=1;i<=n;i++)
sc...
分类:
其他好文 时间:
2015-04-26 18:20:19
阅读次数:
137
#include "stdafx.h"
#include #include using namespace std; class MyString
{
private: char *str;
public: MyString(char *s) { str=new char[strlen(s)+1];...
分类:
其他好文 时间:
2015-04-26 18:20:02
阅读次数:
108
http://soj.sysu.edu.cn/show_problem.php?pid=1005&cid=1779 1 #include 2 3 using namespace std; 4 5 int graph[101][101]; 6 int kind[101][101]; 7 int...
分类:
其他好文 时间:
2015-04-26 18:18:43
阅读次数:
141
1>通过ie浏览器的activx获取当前登录账户,其它浏览器不行,不支持activx。 1 2 3 4 5 6 7 8 9 10 11 12 13 16 23 24 2>rtx常用接口封装 1 using System; 2 u...
分类:
其他好文 时间:
2015-04-26 18:15:11
阅读次数:
268
高级版
代码:
#include
using namespace std;
const int N=1e6+5;
int father[N];//父亲
int n,m,a,b;
int rank[N];//树的高度
int find(int x)//查询树的根
{
if(x==father[x]) return x;
else return father[x]=find(fa...
分类:
其他好文 时间:
2015-04-26 16:49:11
阅读次数:
111
#include
//n!的求解
using namespace std;
int Giral(int n)
{
(n>2) && (n*=Giral(n-1));//这里不能写n>0,因为n=0时会返回0,将乘式的结果会化成0,n>2比n>1要少一次,效率要高一些.
return n;
}
int main()
{
cout<<Giral(4)<<endl;
}
#include
...
分类:
编程语言 时间:
2015-04-26 16:47:43
阅读次数:
240
今天调试程序时,遇到这么一个错误:
error C2227: left of '->first' must point to class/struct/union
#include
using namespace std;
#define ElemType int
struct node
{
struct node *first;
struct node *last;
int size...
分类:
其他好文 时间:
2015-04-26 16:47:33
阅读次数:
131
c#修改注册表,需要引用Microsoft.Win32命名空间using Microsoft.Win32; //声明 ///引用 RegistryKey reg; reg = Registry.ClassesRoot;以下从‘读’‘写’‘删除’‘判断’四个事例实现对注册表的简单操作 1.读取指定名称...