摘要:
既然输入的是损坏率,那1-x就是剩余的。最后只要剩余的最大。#include#include#define Max 99999999const int maxn=1003;double dis[maxn],map[maxn][maxn];int vis[maxn],n,val[maxn];void ... 阅读全文
摘要:
2边SPFA 然后求和#include#include#include#define INF 1000000000#define ii __int64using namespace std;struct node{ ii v; ii val; ii next;}edge1[1000... 阅读全文
摘要:
floyd一遍即可。如果floyd后值有变大就是#include#include#include#include#include#define INF 99999999using namespace std;const int maxn=36;double mmap[maxn][maxn],val;... 阅读全文
摘要:
输入是2个不在一起的人,可以用一个数组来保存和他矛盾的人。这样find的时候就find(hash[]);就可以;#include#includeint pa[100020],h[100020],n;void init(){ for(int i=0;i<=n;i++) { p... 阅读全文
摘要:
比较恶心1: 0 0 空树是一棵树2: 1 1 0 0 不是树 3: 1 2 1 2 0 0 不是树...4: 1 2 2 3 4 5 不是树 森林不算是树5: 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 1 错6: 1 2 2 1 0 0 也是错误的#include#i... 阅读全文
摘要:
#include#include#includeusing namespace std;int main(){ int n,m,i,j; char name[10003][33],str[33]; string s1,s2; while(scanf("%d",&n)!=EOF... 阅读全文
摘要:
https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1332#include#include#include#include#includeusing name... 阅读全文
摘要:
QueuesandPriority Queuesare data structures which are known to most computer scientists. TheTeam Queue, however, is not so well known, though it occur... 阅读全文
摘要:
题意:最小生成树的最大边最小,sort从小到大即可poj2485#include#include#includeusing namespace std;#define maxn 505int map[maxn][maxn],pa[150000],num,n;struct node{ int x... 阅读全文
摘要:
判断最小生成树是否唯一。kruskal时记录需要的边,然后枚举删除它们,每次删除时进行kruskal,如果值未变,表明不唯一。#include#include#include#includeusing namespace std;struct Node{ int l; int r; ... 阅读全文