백준2903: 중앙 이동 알고리즘
문제
https://www.acmicpc.net/problem/2903
문제 풀이
1
2
3
4
5
6
7
8
9
10
11
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int answer = (int) Math.pow(Math.pow(2, n) + 1, 2);
System.out.println(answer);
}
}
댓글남기기