목록Problem Solving (223)
Life Engineering
https://programmers.co.kr/learn/courses/30/lessons/60063 코딩테스트 연습 - 블록 이동하기 [[0, 0, 0, 1, 1],[0, 0, 0, 1, 0],[0, 1, 0, 1, 1],[1, 1, 0, 0, 1],[0, 0, 0, 0, 0]] 7 programmers.co.kr #include #include #include #include #include using namespace std; int dx[4]={-1,1,0,0}; int dy[4]={0,0,-1,1}; struct Robot{ pair a; pair b; int cnt; }; int solution(vector board) { int answer = 0; int N=board.size()-1; b..
https://www.acmicpc.net/problem/17142 17142번: 연구소 3 인체에 치명적인 바이러스를 연구하던 연구소에 승원이가 침입했고, 바이러스를 유출하려고 한다. 바이러스는 활성 상태와 비활성 상태가 있다. 가장 처음에 모든 바이러스는 비활성 상태이고 www.acmicpc.net #include #include #include #include #define MAX 987654321 using namespace std; int N, M; int graph[51][51]; int ans = MAX; vector viruses; int dx[4] = { -1,1,0,0 }; int dy[4] = { 0,0,-1,1 }; void bfs(vector& temp) { int visited[..
https://programmers.co.kr/learn/courses/30/lessons/87946 코딩테스트 연습 - 피로도 XX게임에는 피로도 시스템(0 이상의 정수로 표현합니다)이 있으며, 일정 피로도를 사용해서 던전을 탐험할 수 있습니다. 이때, 각 던전마다 탐험을 시작하기 위해 필요한 "최소 필요 피로도"와 던 programmers.co.kr #include #include #include using namespace std; int solution(int k, vector dungeons) { int answer = -1; vector perm; for (int i=0; i
https://programmers.co.kr/learn/courses/30/lessons/17683 코딩테스트 연습 - [3차] 방금그곡 방금그곡 라디오를 자주 듣는 네오는 라디오에서 방금 나왔던 음악이 무슨 음악인지 궁금해질 때가 많다. 그럴 때 네오는 다음 포털의 '방금그곡' 서비스를 이용하곤 한다. 방금그곡에서는 TV, programmers.co.kr #include #include #include #include using namespace std; struct info{ string name; int time; int order; }; bool cmp(info i1, info i2){ if (i1.time==i2.time){ return i1.order < i2.order; } return i..