Algorithms19 [BOJ] 15655. N과 M (7) https://www.acmicpc.net/problem/15656 15656번: N과 M (7) N개의 자연수와 자연수 M이 주어졌을 때, 아래 조건을 만족하는 길이가 M인 수열을 모두 구하는 프로그램을 작성하시오. N개의 자연수는 모두 다른 수이다. N개의 자연수 중에서 M개를 고른 수열 같은 수를 여러 번 골라도 된다. www.acmicpc.net #include #include #include #include using namespace std; int N, M, numbers[7]; vector series; void dfs(int cnt); void print(); int main() { cin.tie(0); ios::sync_with_stdio(0); cin >> N >> M; for (in.. 2019. 4. 18. [SWEA] 1926. 간단한 369게임 https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PTeo6AHUDFAUq&categoryId=AV5PTeo6AHUDFAUq&categoryType=CODE SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! www.swexpertacademy.com 정수를 문자열로 바꿔주는 to_string() 함수를 알고 있어야 풀 수 있는 문제이다. * string to int, int to string 변환 함수 string to int int to string atoi(char*) to_string(int) string str = "123"; int num = at.. 2019. 4. 17. [SWEA] 2005. 파스칼의 삼각형 https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5P0-h6Ak4DFAUq&categoryId=AV5P0-h6Ak4DFAUq&categoryType=CODE SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! www.swexpertacademy.com 파스칼의 삼각형 규칙인 '두 번째 줄부터 각 숫자들은 자신의 왼쪽과 오른쪽 위의 숫자의 합으로 구성된다.'를 코드로 표현하면 된다. #include #include using namespace std; int T, N, triangle[10][10]; void initializeTriangle();// tria.. 2019. 4. 17. [SWEA] 1940. 가랏! RC카! https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PjMgaALgDFAUq&categoryId=AV5PjMgaALgDFAUq&categoryType=CODE&&& SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! www.swexpertacademy.com #include #include using namespace std; int T, N, command, speed; int currentSpeed, currentDistance; void getDistance(); int main() { cin.tie(0); ios::sync_with_stdio(0); c.. 2019. 4. 17. 이전 1 2 3 4 5 다음