본문 바로가기
반응형

완전탐색3

[프로그래머스 - 완전탐색] 소수 찾기 📄 [완전탐색] 숫자 야구 C++ Source Code #include #include #include #include using namespace std; #define MAX_V 9999999 #define LONG unsigned long long void prime(vector & isPrime, const int size) { for (LONG ii = 2; ii = 2) { answer++; } } return answer; } 🚀 REFERENCE GitHub C++ Source Code URL Programmers Problem URL 2019. 4. 15.
[프로그래머스 - 탐색] 타겟 넘버 카테고리 (Category) 작성 날짜 (Write Date) 최근 수정 날자 (Recent Write Date) 작성자 (Writer) Algorithm 2019.04.14 21:37 2021.05.04. 22:35 Dev.Yang n개의 음이 아닌 정수가 있습니다. 이 수를 적절히 더하거나 빼서 타겟 넘버를 만들려고 합니다. 예를 들어 [1, 1, 1, 1, 1]로 숫자 3을 만들려면 다음 다섯 방법을 쓸 수 있습니다. 사용할 수 있는 숫자가 담긴 배열 numbers, 타겟 넘버 target이 매개변수로 주어질 때 숫자를 적절히 더하고 빼서 타겟 넘버를 만드는 방법의 수를 return 하도록 solution 함수를 작성해주세요. [제한사항] 주어지는 숫자의 개수는 2개 이상 20개 이하입니다. 각 숫.. 2019. 4. 14.
[프로그래머스 - 완전탐색] 숫자 야구 📄 [완전탐색] 숫자 야구 C++ Source Code #include #include #include #include using namespace std; #define INT_PAIR pair #define CUS_PAIR pair #define START 123 #define END 987 const bool findDigit(const INT_PAIR condition, const string target, const string match) { INT_PAIR conds = make_pair(0, 0); for (int ii = 0; ii < target.size(); ii++) { for (int jj = 0; jj < match.size(); jj++) { // Case Find Strike.. 2019. 4. 5.
반응형