NYOJ 45 棋盘覆盖

Posted on 2013-07-28 21:04  冰天雪域  阅读(137)  评论(0编辑  收藏  举报

棋盘覆盖


水题,题不难,找公式难

import java.math.BigInteger;
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner input=new Scanner(System.in);
		int n=input.nextInt();
		while(n-->0){
			int k =input.nextInt();	
			System.out.println(BigInteger.valueOf(4).pow(k).subtract(BigInteger.ONE).divide(BigInteger.valueOf(3)));
		}
	}
}


 

Copyright © 2024 冰天雪域
Powered by .NET 9.0 on Kubernetes