留意到,每一种语言的情况其实是独立的,也就是说,每一种语言的集合的包含的情况都是符合要求的。一种语言在图上可以有32种情况(由数据2知),所以,总的数就是32^n
import java.util.*;
import java.math.*;
public class Main {
	static public void main(String []args){
		Scanner scan=new Scanner(System.in);
		int T,icase=0;
		T=scan.nextInt();
		while(T-->0){
			int n;
			n=scan.nextInt();
			System.out.printf("Case #%d: ",++icase);
			System.out.println(BigInteger.valueOf(32).pow(n));
		}
		scan.close();
	}
}
原文:http://www.cnblogs.com/jie-dcai/p/4539473.html