【算法系列 三】 Quene
1. 拓扑排序问题( HDU 1285 ) import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.StreamTokenizer; public class Main { static int[] inDegree = new int[502]; static int[][] v = new int[502][502]; static boolean[] contain = new boolean[502]; public static void main(String[] args) throws IOException { StreamTokenizer in = new StreamTokenizer(new BufferedReader( new InputStreamReader(System.in))); int n, m; while (in.nextToken() != StreamTokenizer.TT_EOF) { n = (int) in.nval; in.nextToken(); m = (int) in.nval; init(n); for (int i = 1; i <= m; i++) {