Genealogical tree Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8003 Accepted: 5184 Special Judge Description The system of Martians' blood relations is confusing enough. Actually, Martians bud when they want and where they want. T…
题目:火星人的血缘关系,简单拓扑排序.很久没用邻接表了,这里复习一下. import java.util.Scanner; class edge { int val; edge next; } public class Main { static int n; static int MAXV = 1001; static edge head[] = new edge[MAXV]; static int in[]; static boolean vis[]; public static void…
题目连接 http://poj.org/problem?id=2367 Genealogical tree Description The system of Martians' blood relations is confusing enough. Actually, Martians bud when they want and where they want. They gather together in different groups, so that a Martian can…
题目链接 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]; //记…
Genealogical tree Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 3674 Accepted: 2445 Special Judge Description The system of Martians' blood relations is confusing enough. Actually, Martians bud when they want and where they want. T…
Genealogical tree Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7101 Accepted: 4585 Special Judge Description The system of Martians' blood relations is confusing enough. Actually, Martians bud when they want and where they want. They ga…