728x90 반응형 백준 9095번 123 더하기 C++1 BOJ-백준 9095번 1,2,3 더하기 C++ BOJ-백준 9095번 1,2,3 더하기 C++ 문제 풀이 입니다. 링크 : https://www.acmicpc.net/problem/9095 9095번: 1, 2, 3 더하기 각 테스트 케이스마다, n을 1, 2, 3의 합으로 나타내는 방법의 수를 출력한다. www.acmicpc.net ✅ C++ 정답 코드 입니다. 더보기 클릭! 더보기 #include using namespace std; // 알고리즘 분류 다이나믹 프로그래밍 int n; int fact[12]; int factorial(int x){ if (x==0 || x == 1) return fact[x] = 1; else if (fact[x]==0) return x*factorial(x-1); else return fact[x]; } int.. 2021. 10. 27. 이전 1 다음 728x90 반응형