- 博客(4)
- 收藏
- 关注
原创 poj1094 Sorting It All Out
poj1094 本题数据有bug,只需要输出第一个产生的答案不需要管后面的会不会产生矛盾。只需要用poj1270的思路即可。#include<cstdio>#include<iostream>#include<algorithm>#include<cstring>using namespace std;int n, m;int g[30][30], in[30], tp[30], to
2016-09-12 15:06:58 275
原创 poj1270 Following Orders
poj1270在找入度0的拓扑排序算法基础上,加入回溯,对入度被减掉的点进行还原,即可找到所有拓扑序列。对于字典序最小可以先对原序列排序。#include<cstdio>#include<iostream>#include<algorithm>#include<cstring>using namespace std;int g[30][30], in[30], tp[30], n;char
2016-09-08 21:28:58 459
原创 poj2367 Genealogical tree
poj2367拓扑排序的一道裸题。#include<cstdio>#include<iostream>using namespace std;const int maxn = 100 + 10;int n, a[maxn][maxn], tp[maxn], t, vis[maxn];void init(){ scanf("%d", &n); for(int i = 1; i <
2016-09-08 21:26:34 225
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人