Notice
Recent Posts
Recent Comments
Link
목록15650 (1)
Be a developer
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/clk21O/btqt4zt7bai/OcWSQYBktR2nLzKmh09dA0/img.png)
N과 M (1) 문제에서 조금만 변형시키면 된다. 오름차순으로 출력해야 하므로, solve 안에서 for 문의 i는 인자인 num보다 1크게 하여 시작한다. 중복은 알아서 걸러지므로 삭제 시켜도 된다. 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 #include #include #include #include using namespace std; int n, m; vector v; void solve(int num) { //뽑아야 할 개수만큼 뽑고 나면 출력한다. if (v.size() == m) { for (auto x : v) { printf("%d ", x); } printf("\n"..
알고리즘
2019. 4. 4. 15:59