Algorithm/조합
![[알고리즘] 백준 1940 주몽 // 조합은 재귀로](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdJKbDf%2FbtsLAWSfm6h%2FgTfrDQyNKPWs1fRKkh5q80%2Fimg.png)
[알고리즘] 백준 1940 주몽 // 조합은 재귀로
* next_permutation 풀이 단점 : 시간복잡도가 nCr * n 이다. -> 터짐주의점 : arr이 아니고 v를 돌려야함.#include using namespace std;using ll = long long;ll n, m, ret;vector arr;int main() { ios_base::sync_with_stdio(0); cin.tie(0); cin >> n >> m; if(m > 200000) { cout v(n-2,0); // 조합용 벡터 v.push_back(1); v.push_back(1); for (int i = 0; i >tmp; arr.push_back(tmp); } do { ..