교란순열 #백준 #1947 #boj #알고리즘 #PS (1) 썸네일형 리스트형 [Boj 1947] 선물 전달 http://icpc.me/1947 1947번: 선물 전달경우의 수를 1,000,000,000으로 나눈 나머지를 첫째 줄에 출력한다.www.acmicpc.net교란순열이다dp[i] = (i-1) * (dp[i-1] + dp[i-2])#include using namespace std;using ll = long long;const int MOD = 1e9;int n;ll dp[1000000 + 5];int main() { cin.tie(0)->sync_with_stdio(0); cin >> n; dp[2] = 1; for (int i = 3; i 이전 1 다음