棋盘覆盖


水题,题不难,找公式难

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)));
		}
	}
}


 

相关文章:

  • 2021-08-19
  • 2021-12-14
  • 2021-07-28
  • 2021-12-31
猜你喜欢
  • 2021-08-13
  • 2022-02-24
  • 2022-01-18
  • 2022-12-23
相关资源
相似解决方案