题目链接 http://poj.org/problem?id=2367 题意就是给定一系列关系,按这些关系拓扑排序. #include<cstdio> #include<cstring> #include<queue> #include<vector> #include<algorithm> using namespace std; ; int ans; int n; int in[maxn]; //记录入度 int num[maxn]; //记…
poj 1094 Sorting It All Out Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%lld & %llu Description An ascending sorted sequence of distinct values is one in which some form of a less-than operator is used to order the elements from sm…
http://poj.org/problem?id=1094 Sorting It All Out Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 24505 Accepted: 8487 Description An ascending sorted sequence of distinct values is one in which some form of a less-than operator is use…
Description An ascending sorted sequence of distinct values is one in which some form of a less-than operator is used to order the elements from smallest to largest. For example, the sorted sequence A, B, C, D implies that A < B, B < C and C < D.…
题意:给出n个字符,m对关系,让你输出三种情况: 1.若到第k行时,能判断出唯一的拓扑序列,则输出: Sorted sequence determined after k relations: 序列 2.若到第k行,出现环,则输出: Inconsistency found after k relations. 3.若直到m行后,仍判断不出唯一的拓扑序列,则输出: Sorted sequence cannot be deter…
Description An ascending sorted sequence of distinct values is one in which some form of a less-than operator is used to order the elements from smallest to largest. For example, the sorted sequence A, B, C, D implies that A < B, B < C and C < D.…
题意:是否唯一确定顺序,根据情况输出 #include <iostream> #include<cstdio> #include<cstring> #include<stack> using namespace std; /* run this program using the console pauser or add your own getch, system("pause") or input loop */ #define N…