프로그래머스(MySQL) / IS NULL(이름이 없는 동물의 아이디, 이름이 있는 동물의 아이디, NULL 처리하기)
IS NULL(이름이 없는 동물의 아이디, 이름이 있는 동물의 아이디, NULL 처리하기) 링크를 누르면 각 문제로 이동합니다! 이름이 없는 동물의 아이디 이름이 있는 동물의 아이디 NULL 처리하기 이름이 없는 동물의 아이디 https://programmers.co.kr/learn/courses/30/lessons/59039 코딩테스트 연습 - 이름이 없는 동물의 아이디 ANIMAL_INS 테이블은 동물 보호소에 들어온 동물의 정보를 담은 테이블입니다. ANIMAL_INS 테이블 구조는 다음과 같으며, ANIMAL_ID, ANIMAL_TYPE, DATETIME, INTAKE_CONDITION, NAME, SEX_UPON_INTAKE는 각각 동물의 아이디 programmers.co.kr 코드 SELECT..
2022. 1. 19.
알고리즘(C++) / 프로그래머스 위클리 챌린지 : 전력망을 둘로 나누기
위클리 챌린지(9주차) : 전력망을 둘로 나누기 https://programmers.co.kr/learn/courses/30/lessons/86971 코딩테스트 연습 - 9주차 9 [[1,3],[2,3],[3,4],[4,5],[4,6],[4,7],[7,8],[7,9]] 3 7 [[1,2],[2,7],[3,7],[3,4],[4,5],[6,7]] 1 programmers.co.kr 코드 //프로그래머스 전력망을 둘로 나누기 #include #include #include #include #include using namespace std; int solution(int n, vector wires) { int answer = 1000001; //연결되어있는 노드 vec에 저장 vector vec(n + 1)..
2021. 10. 6.
알고리즘(C++) / 프로그래머스 level 3 : 정수 삼각형
level 3 : 정수 삼각형 https://programmers.co.kr/learn/courses/30/lessons/43105 코딩테스트 연습 - 정수 삼각형 [[7], [3, 8], [8, 1, 0], [2, 7, 4, 4], [4, 5, 2, 6, 5]] 30 programmers.co.kr 코드 //프로그래머스 정수 삼각형 #include #include #include #include using namespace std; int solution(vector triangle) { int answer = 0; for (int i = 1; i < triangle.size(); i++) { //두번째 줄부터 for (int j = 0; j < triangle[i].size(); j++) { if (..
2021. 9. 28.
알고리즘(C++) / 프로그래머스 위클리챌린지 : 최소직사각형
위클리챌린지 : 최소직사각형 https://programmers.co.kr/learn/courses/30/lessons/86491?language=cpp 코딩테스트 연습 - 8주차 [[10, 7], [12, 3], [8, 15], [14, 7], [5, 15]] 120 [[14, 4], [19, 6], [6, 16], [18, 7], [7, 11]] 133 programmers.co.kr 코드 //프로그래머스 최소직사각형 #include #include #include #include using namespace std; int solution(vector sizes) { int answer = 0; int max_col = 0; int max_row = 0; for (int i = 0; i < size..
2021. 9. 27.