본문 바로가기

Coding/백준 온라인 저지 (Baekjoon Online Judge)

백준 온라인 저지(Baekjoon Online Judge) - 2903 : 중앙 이동 알고리즘

https://www.acmicpc.net/problem/2903

 

2903번: 중앙 이동 알고리즘

상근이는 친구들과 함께 SF영화를 찍으려고 한다. 이 영화는 외계 지형이 필요하다. 실제로 우주선을 타고 외계 행성에 가서 촬영을 할 수 없기 때문에, 컴퓨터 그래픽으로 CG처리를 하려고 한다.

www.acmicpc.net

 

#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#include <vector>
using namespace std;
 
int main(int argc, char *argv[])
{
	int n;
	int x = 2;
 
	cin >> n;
 
	while(n--) {
		x += (x - 1);
	}
 
	x *= x;
 
	cout << x << endl;
 
	return 0;
}