백준 24723 녹색거탑 / C++

이유참치·2025년 12월 15일

백준

목록 보기
190/249

문제 : 24723

풀이 point

직접 경우의 수를 구해보면 패턴을 발견할 수 있다.
2N2^N이다.

코드

//백준 24723, 녹색거탑

#include <iostream>

int main (){
    int N;
    std::cin >> N;
    int ans{1};
    for(int i{1}; i<=N; ++i){
        ans*=2;
    }

    std::cout << ans;


    return 0;
}
profile
임아리 - 대학생

0개의 댓글