[BOJ/C++] 2903 중앙 이동 알고리즘

mani·2023년 5월 30일
0

baekjoon_step

목록 보기
69/73


둘씩 반복해서 나눴을 때 점의 개수를 세는 문제

#include <iostream>

using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	int N;
	cin >> N;
	int ans = 2;
	for (int i = 0; i < N; i++) {
		ans = ans + (ans - 1);
	}
	cout << ans * ans;
	return 0;
}
profile
log

0개의 댓글

관련 채용 정보