코딩테스트/프로그래머스 (10) 썸네일형 리스트형 [프로그래머스 C++] 250137. 1번 / 붕대 감기 문제 링크 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr 접근 방법공격 시간에 따라 현재 체력을 계산합니다.소스 코드#include #include using namespace std;int solution(vector bandage, int health, vector> attacks){ int s = 1, time, curHealth = health; for (auto &a : attacks) { time = a[0] - s; curHealth += (time / bandage[0]) * (bandage[2].. [프로그래머스 C++] 43162. 네트워크 문제 링크 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr접근 방법A와 B가 연결되어 있고 B와 C가 연결되어 있을 때, A와 C도 연결되어 있다에서Union-Find로 접근해 보기로 했습니다.소스 코드#include #include using namespace std;int *uf;int find_root(int n){ if (uf[n] == n) return n; return uf[n] = find_root(uf[n]);}void union_find(int x, int y){ int parentX, parentY; .. 이전 1 2 다음