
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine()); //테스트 케이스 개수
double result= 0;
result = (Math.pow(4,n)+Math.pow(2,n+1)+1);
System.out.println((int)result);
}
}
그냥 등비수열로 풀었다
제곱식을 구할때 함수
Math.pow(2,n) = 2^n
'개발자 > Baekjoon' 카테고리의 다른 글
10757번 백준 (0) | 2023.06.26 |
---|---|
2745 백준 -자바 (0) | 2023.04.10 |
2563 백준 - java (0) | 2023.04.09 |
10798 백준 - 자바 (0) | 2023.04.02 |
25206 - 백준 - java (0) | 2023.03.26 |
댓글