
拓扑排序
lp_opai
我没有时间写一封简短的信,所以我写了一封长的。
展开
-
hdu 4857 逃生(逆向拓扑+优先队列)
//不是保证字典序,而是要最小的尽量在前面。/* 案例 1 4 2 3 1 4 1 3 4 1 2 *///- -弱弱备注给自己看# include # include # include # include # include using namespace std;# define N 30005vectorg[N];int vis[N原创 2014-07-21 13:44:15 · 896 阅读 · 0 评论 -
poj 1094
第i个物品 第几重// 逆向拓扑# include # include using namespace std;int n,m,top,map[27][27],into[27],outto[27];char str[27],buf[10];int floyd(){ int i,j,k; for(k=0;k<n;k++) { for(i=0;i<n;i++) {原创 2014-07-14 19:43:17 · 547 阅读 · 0 评论 -
HDU 1811 Rank of Tetris
# include # include # include # include using namespace std;int father[10010],r[20005],l[20005],into[10010],n;char ch[20005];int find(int x){ if(x==father[x]) return x; return father[x]=fi原创 2014-07-15 09:29:31 · 581 阅读 · 0 评论