코딩 테스트/프로그래머스 코딩테스트 (26) 썸네일형 리스트형 [프로그래머스] 포켓몬 https://school.programmers.co.kr/learn/courses/30/lessons/1845 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr 너무 어려웠다.ㅋㅋ 도저히 어떻게 푸는지 몰라서 다른 사람들꺼 참조..https://goliot-coding.tistory.com/22 [C++][해시] 프로그래머스 - 폰켓몬기본적인 해시 문제이다. unordered_set은 중복을 허용하지 않으므로 벡터에 들어있는 모든 숫자들을 unordered_set에 삽입하면 자연스럽게 폰켓몬의 종류를 구할 수 있다. 예외사항으로, 폰켓몬의 종goliot-coding.tistory.com 위에꺼 참조하고 .. [프로그래머스] 완주하지 못 한 선수 https://school.programmers.co.kr/learn/courses/30/lessons/42576/solution_groups?language=cpp&type=my 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr #include #include #include using namespace std;string solution(vector participant, vector completion) { string answer = ""; // 완전탐색으로 할 수도 있지만 복잡도가 너무 높을 것으로 예상 -> N^2 // 그러면 hash map에 저장해서 탐색하면 될 것 같은데,,.. [프로그래머스] 바탕화면 정리 https://school.programmers.co.kr/learn/courses/30/lessons/161990 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr #include #include #include using namespace std;vector solution(vector wallpaper) { vector answer; // 0. 2차원 지도로 만들기 (아래쪽 방향 : +x, 오른쪽 방향 : +y) // 1. 파일이 존재하는 취소 위치 (x,y) 찾기 (단, 파일이 존재하는지 확인해야 함) // 1-1. 첫번째 좌표 : 최소 x, 최소 y // 1-2... [프로그래머스] 크기가 작은 부분 문자열 https://school.programmers.co.kr/learn/courses/30/lessons/147355 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr #include #include #include using namespace std;int solution(string t, string p) { int answer = 0; // 문자열 p의 크기만큼 쪼개기 int N = t.size(); int M = p.size(); // 7, 3 -> 5 int iter = N-M+1; vector vec_str; for(int i=0; .. [프로그래머스] 공원 산책 C++ https://school.programmers.co.kr/learn/courses/30/lessons/172928?language=cpp 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr 개어렵다.. 테스트는 통과했지만채점 결과, 무자비한 Segmentation fault... #include #include #include using namespace std;vector solution(vector park, vector routes) { vector answer; vector> map; vector map_row; int cur_row = 0; int cur.. [프로그래머스] 추억 점수 https://school.programmers.co.kr/learn/courses/30/lessons/176963 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr #include #include #include using namespace std;vector solution(vector name, vector yearning, vector> photo) { vector answer; std::map name_point; // name, yearning 값을 map에 복사 for(int i=0; i 요즘 chat gpt로 코드 짜다보니 코드 짜는 실력이 상당히 낮아졌습.. 과일 장수 https://school.programmers.co.kr/learn/courses/30/lessons/135808 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr #include #include #include using namespace std;// k : 최고 점수// m : 포장할 수 있는 사과 갯수// score : 사과의 점수// 사과의 최종 점수는 사과의 가장 낮은 점수 기준으로 환산int solution(int k, int m, vector score) { int total_score = 0; if(score.size() = m){ .. 달리기 경주 https://school.programmers.co.kr/learn/courses/30/lessons/178871# 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr #include using namespace std;vector solution(vector players, vector callings) { vector answer; for(int i=0; i 이렇게 하니까 시간 오류가 나더라구여 힌트를 보아하니 map을 사용하라길래.. 다시 짜봤습니다 ㅎㅎ왜냐하면 제가 지금 짠 것은 swap을 하고자 2중 for문을 돌리기 때문에 O(N^2.. 둘만의 암호 https://school.programmers.co.kr/learn/courses/30/lessons/155652 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr #include using namespace std;string solution(string s, string skip, int index) { string answer = ""; for(int i=0; i 꿀팁!1. z에서 a로 그리고 Z에서 A로 변환하려면 26을 빼주면 된다. (원리는 아스키 코드 참조)2. string 안에 문자 c가 있는지 없는지 판별하고 싶으면 stri.. 카드 뭉치 https://school.programmers.co.kr/learn/courses/30/lessons/159994 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr #include using namespace std;string solution(vector cards1, vector cards2, vector goal) { string answer = ""; int total_size = goal.size(); int card1_size = 0; int card2_size = 0; for(int i=0; i 오늘의 꿀팁.. 이전 1 2 3 다음