摘要:
题意:给出一棵树的点数N,输入M行,每行输入父亲节点An,儿子个数n,和a1,a2,...,an(儿子结点编号),从根节点层级向下依次输出当前层级叶子结点个数,用空格隔开。(0<N<100) AAAAAccepted code: 1 #include<bits/stdc++.h> 2 using n 阅读全文
摘要:
题意:n个点,m条双向边,每条边给出通过用时,每个点给出点上的人数,给出起点终点,求不同的最短路的数量以及最短路上最多能通过多少人。(N<=500) AAAAAccepted code: 1 #include<bits/stdc++.h> 2 using namespace std; 3 int n 阅读全文
摘要:
1 #include<bits/stdc++.h> 2 using namespace std; 3 int n,m,l,t; 4 int a[1307][137][67]; 5 int vis[1307][137][67]; 6 typedef struct{ 7 int x,y,z; 8 }no 阅读全文