분류 전체보기 203

프로그래머스 - 카카오프렌즈 컬러링 북 - C++

https://school.programmers.co.kr/learn/courses/30/lessons/1829 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr #include using namespace std;int dy[4]={0,1,0,-1};int dx[4]={-1,0,1,0};bool CheckPos(int x,int y,int m,int n){ if(x>=0 && x=0 && y>& board, vector>& ch,int x,int y,int type,int& cnt,int m,int n){ for(int i=0;i so..

프로그래머스 - 가장 큰 수 - C++

https://school.programmers.co.kr/learn/courses/30/lessons/42746 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr #include #include #include using namespace std;bool compare(int a, int b){ string sa=to_string(a); string sb = to_string(b); return sa+sb > sb+sa;}string solution(vector numbers) { string answer = ""; stable_so..

프로그래머스 - 괄호 변환 - C++

https://school.programmers.co.kr/learn/courses/30/lessons/60058 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr #include #include using namespace std;string solution(string p) { string u = ""; if(p=="")return ""; // 분리 int cnt=0; bool b = true; string v=""; for(int i=0;i이 문제는 재귀함수를 이용해 주어진 알고리즘대로 돌아가게끔 코드를 만들어 리턴하는..

프로그래머스 - [3차] 방금그곡 - C++

https://school.programmers.co.kr/learn/courses/30/lessons/17683 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr #include #include #include using namespace std;void convertSharp(string &s){ string ss=""; for(int i=0;i musicinfos) { string answer = ""; convertSharp(m); int longestTime =-1; for (string s : musicinfos..

프로그래머스 - 두 큐 합 같게 만들기 - C++

https://school.programmers.co.kr/learn/courses/30/lessons/118667#qna 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr #include #include #include using namespace std;int solution(vector queue1, vector queue2) { int answer = 0; list l1; list l2; long long sum1=0,sum2=0; for(int i=0;i=maxCnt)break; if(sum1>sum2) ..

프로그래머스 - [1차] 프렌즈 4블록 - C++

https://school.programmers.co.kr/learn/courses/30/lessons/17679 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr #include #include using namespace std;bool cal(int& answer, vector& board){ vector> savePos; vector chB; for (int i = 0; i board) { int answer = 0; while (cal(answer, board)) { for (int i = 0; i =1 ;..

프로그래머스 - 수식 최대화 - C++

https://school.programmers.co.kr/learn/courses/30/lessons/67257#qna 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr #include #include #include #include #include using namespace std;long long cal(long long a, long long b, char op){ if (op == '*') return a * b; else if (op == '+') return a + b; else return a..

프로그래머스 - 문자열 압축 - C++

https://school.programmers.co.kr/learn/courses/30/lessons/60057 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr #include #include using namespace std;int solution(string s) { int answer = 1001; if(s.length()==1) return 1; for(int i=1;i1) { temp += to_string(cnt) + s.substr(j-i,i); ..

프로그래머스 - 메뉴 리뉴얼 - C++

https://school.programmers.co.kr/learn/courses/30/lessons/72411 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr #include #include #include using namespace std;void recur(vector>& data, int len,string s,int idx,string curS){ if(len == s.length()|| curS[curS.length()-1]==s[s.length()-1]) return; for(int i=idx;i solution(..

프로그래머스 - [3차] 파일명 정렬 - C++

https://school.programmers.co.kr/learn/courses/30/lessons/17686 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr #include #include #include #include using namespace std;bool compare(const pair>& a,const pair>& b){ if(a.second[0]!=b.second[0]) return a.second[0] solution(vector files) { vector answer; vector>> data; in..