Notice
Recent Posts
Recent Comments
Link
목록N과 M (1) (1)
Be a developer
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/dLEMlp/btqt7R8oZRn/vBoIVhl8noTosZD01zG4Wk/img.png)
앞선 재귀 문제들처럼 vector에 원소를 넣을지 말지를 선택하는 선택하는 문제다. vector에 넣은 원소의 개수가 주어진 수와 같을 때 재귀를 종료시키면 된다. 중복해서 뽑지 않도록 check해주는 것만 조심하면 된다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 #include #include #include #include using namespace std; int n, m; vector v; bool check(int num) { for (int i = 0; i n >> m; solve(); return 0; } Colored by Co..
알고리즘
2019. 4. 4. 15:53