본문 바로가기

C++97

[C++/PGS] Lv.2 : 요격 시스템 https://school.programmers.co.kr/learn/courses/30/lessons/181188 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr프로그래머스 레벨2.그리디 유형의 문제이다처음에 map으로 삽질하다가 힌트 보고 해결했다🥹 타겟의 시작점이 기존의 끝점 이상이라면 answer+1을 해주면 답이 나온다! 나의 풀이#include #include #include #include using namespace std;bool comp(vector a, vector b){ if(a[1]==b[1]) return a[0]> targets) { int answer = 0; int.. 2025. 6. 13.
[C++/PGS] Lv.1 : 신규 아이디 추천(2021 KAKAO) https://school.programmers.co.kr/learn/courses/30/lessons/72410 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr프로그래머스 레벨1.단순하게 조건 하나하나를 처리하며 구현하는 문제!3단계가 조금 까다로운데, 점 갯수를 누적시키며 점이 나오다가 멈췄을 때 ' . '을 하나만 추가해주면 된다 나의 풀이#include #include #include #include using namespace std;string solution(string new_id) { // 1 for(int j=0; j='A' && t='a' && t='0' && t0 && new_i.. 2025. 6. 13.
[C++/PGS] Lv.1 : 유연근무제 https://school.programmers.co.kr/learn/courses/30/lessons/388351 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr프로그래머스 레벨1. 정답률 49%2025 프로그래머스 코드챌린지 1차 예선Level 1인데도 불구하고 정답률이 낮고 조건이 많은 문제였다! 나의 풀이#include #include #include using namespace std;int solution(vector schedules, vector> timelogs, int startday) { int answer = 0; for(int i=0; i7) day = 1; .. 2025. 6. 13.
[C++/PGS] Lv.2 : 지게차와 크레인 https://school.programmers.co.kr/learn/courses/30/lessons/388353# 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr프로그래머스 레벨 22025 프로그래머스 코드 챌린지 1차 예선 문제 - 정답률 42%...꽤 복잡한 구현+그래프 탐색 문제이다. 이 문제의 포인트는 bfs 뿐만아니라, 뺄 수 있는 짐을 어느 루트로 어떻게 탐색할지 찾는게 중요함‼️ 예를 들어서, 명령어가 "A"일 때나는 처음에 'A'라는 짐을 찾고, 이 짐에서 시작하여 모서리까지 도달할 때까지 상하좌우로 탐색했는데이게 아니라 모서리의 빈칸에서 bfs로 'A'까지 도달해야 해결되는 문제였다 ㅠㅠSto.. 2025. 6. 12.
[C++/PGS] Lv.1 : [PCCE 기출문제] 10번 / 공원 https://school.programmers.co.kr/learn/courses/30/lessons/340198# 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr프로그래머스 레벨 1. pcce 기출범위가 충분히 작아서, 반복문을 여러 개 중첩하여 해결할 수 있었다! 나의 풀이#include #include #include #include using namespace std;int solution(vector mats, vector> park) { int answer = -1; sort(mats.begin(), mats.end(), greater()); for(int i=0; i=park.si.. 2025. 6. 11.
[C++/PGS] Lv.1 : 택배 상자 꺼내기 https://school.programmers.co.kr/learn/courses/30/lessons/389478 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr프로그래머스 레벨1. 2025 프로그래머스 코드챌린지 2차 예선 기출 원시 배열 int[][]로 풀었다가 계속 core dumped 에러 떠서 화났는데vector로 바꾸니까 된다. 🤯🤯 나의 풀이#include #include #include #include using namespace std;int solution(int n, int w, int num) { int answer = 0; vector> box; int h = n/w.. 2025. 6. 4.
728x90
반응형