摘要:
#include#include#define N 10char s[N][N][N]={{"***","* *","* *","* *","***"},{" *"," *"," *"," *"," *"},{"***"," *","***","* ","***"},{"***" 阅读全文
摘要:
#include#include#includeusing namespace std;#define N 1100struct nodde {int x,y;}f[N],start;int h,n,m,visitt[N][N];int dis[4][2]={-1,0,1,0,0,1,0,-1};c... 阅读全文
摘要:
#includedouble h;double tt;void s(long long m,long long n) { long long i,j,sum; j=1; sum=1; for(i=n;i>=n-m+1;i--,j++) { sum*=i; sum/=j; }... 阅读全文
摘要:
//假设n个人每个人都做对了两道题,那么要想获奖人数最少的话,那么做题数目肯定最多即全做对的,中间可能会小于零那么没有获奖的#includeint main() { int t,n,m,i,sum; scanf("%d",&t); while(t--) { scanf("%d",&n); ... 阅读全文
摘要:
#include#include#define N 300int pre[N];int find(int u) {if(u!=pre[u]) pre[u]=find(pre[u]);return pre[u];}struct node {int u,v,speed;}ma[1100];int cm... 阅读全文
摘要:
#include#include#define inf 100000000#define N 110#define min(a,b) a>b?b:a;int pre[N][N],dis[N][N],ma[N][N],path[N],num,minf;int n,m;void FLOYD() {int... 阅读全文
摘要:
http://www.cnblogs.com/Yz81128/archive/2012/08/15/2640940.html求最小环floyd求最小环2011-08-14 9:421 定义:通常来说最小环是针对有向图而言从一个点出发,经过一条简单路径回到起点成为环.图的最小环就是所有环中长度最小的.... 阅读全文
摘要:
//对数组排序后,对于边相同并且边的两端不在一个集合内的一定是等效边或者必加边,//第一数数,第二合并集合#include#include#define N 110000int pre[N];struct node {int x,y,w;}ma[N];int findd(int x) {if(x!=... 阅读全文