코딩테스트/프로그래머스 (3) 썸네일형 리스트형 27. 삼각 달팽이 Lv.2 : 월간 코드 챌린지 시즌1_ C++ https://school.programmers.co.kr/learn/courses/30/lessons/68645 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr* 코드#include #include #include using namespace std;vector solution(int n) { vector answer; int arr[1001][1001];// 이걸 좀 보기 편하게 생각해보면 왼쪽으로 쫙 밀었을 때 아래로 쭉 내려갔다가 오른쪽으로 쭉 갔다가 x-1, y-1하면서 올라갔다가를 반복하면서 모든 블록을 채울 때까지 반복하면 된다. int x = 0, y = 0;.. 26. 쿼드압축 후 개수 세기 Lv.3 : 월간 코드챌린지 시즌1 (C++) https://school.programmers.co.kr/learn/courses/30/lessons/68936 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr *코드#include #include using namespace std;int zero,one;void dfs(int y,int x,int size,vector> &arr){ int cur = arr[y][x]; // 맨 처음 값 bool equals=true; // 현재 사각형이 모두 같은수라면 해당 dfs종료한다. // 사각형 내부가 전부 같은 수인지 판별 for(int i = y ; i solutio.. 25. 이진 변환 반복하기 Lv.2 : 월간 코드 챌린지 시즌 1 https://school.programmers.co.kr/learn/courses/30/lessons/70129 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr* 코드#include #include #include #include using namespace std;vector solution(string s) { vector answer; int count = 0; int sum_c = 0; while (s != "1") { // '0' 제거 int pre_size = s.size(); s.erase(remove(s.begin(), s.end.. 이전 1 다음