본문 바로가기

Algorithm/CodeTree

(5)
[CodeTree] 나무박멸 (C++) [삼성 SW 역량테스트 기출] https://www.codetree.ai/training-field/frequent-problems/problems/tree-kill-all 코드트리 | 코딩테스트 준비를 위한 알고리즘 정석 국가대표가 만든 코딩 공부의 가이드북 코딩 왕초보부터 꿈의 직장 코테 합격까지, 국가대표가 엄선한 커리큘럼으로 준비해보세요. www.codetree.ai #include using namespace std; int n, m, k, c, answer; int map[20][20]; int dx1[4] = {0, 0, -1, 1}; int dy1[4] = {-1, 1, 0, 0}; int dx2[4] = {-1, -1, 1, 1}; int dy2[4] = {-1, 1, -1, 1}; void Growth(){ for(..
[CodeTree] 바이러스 백신 (C++) [삼성 SW 역량테스트 기출] https://www.codetree.ai/training-field/frequent-problems/problems/vaccine-for-virus 코드트리 | 코딩테스트 준비를 위한 알고리즘 정석 국가대표가 만든 코딩 공부의 가이드북 코딩 왕초보부터 꿈의 직장 코테 합격까지, 국가대표가 엄선한 커리큘럼으로 준비해보세요. www.codetree.ai #include #include #include #include #include using namespace std; int n, m, answer = 987654321; int map[50][50]; int tmp[50][50]; int visited[50][50]; vector hospital; vector picked; bool isUsed[10]; ..
[CodeTree] 방화벽 설치하기 (C++) [삼성 SW 역량테스트 기출] https://www.codetree.ai/training-field/frequent-problems/problems/firewall-installation 코드트리 | 코딩테스트 준비를 위한 알고리즘 정석 국가대표가 만든 코딩 공부의 가이드북 코딩 왕초보부터 꿈의 직장 코테 합격까지, 국가대표가 엄선한 커리큘럼으로 준비해보세요. www.codetree.ai #include #include #include #include using namespace std; int n, m, answer; int map[8][8]; int tmp[8][8]; bool isUsed[64]; int dx[4] = {-1, 0, 0, 1}; int dy[4] = {0, -1, 1, 0}; vector blank; vector..
[CodeTree] 병원 거리 최소화하기 (C++) [삼성 SW 역량테스트 기출] https://www.codetree.ai/training-field/frequent-problems/problems/min-of-hospital-distance 코드트리 | 코딩테스트 준비를 위한 알고리즘 정석 국가대표가 만든 코딩 공부의 가이드북 코딩 왕초보부터 꿈의 직장 코테 합격까지, 국가대표가 엄선한 커리큘럼으로 준비해보세요. www.codetree.ai #include #include #include using namespace std; int n, m, answer = 987654321; int city[50][50]; bool isUsed[13]; vector patient; vector hospital; vector picked; void dfs(int depth, int start){ ..
[CodeTree] 바이러스 검사 (C++) [삼성 SW 역량테스트 기출] https://www.codetree.ai/training-field/frequent-problems/problems/virus-detector 코드트리 | 코딩테스트 준비를 위한 알고리즘 정석 국가대표가 만든 코딩 공부의 가이드북 코딩 왕초보부터 꿈의 직장 코테 합격까지, 국가대표가 엄선한 커리큘럼으로 준비해보세요. www.codetree.ai #include using namespace std; int n, leader, member; int customer[1000001]; long long answer; int main() { cin >> n; for(int i = 0; i > customer[i]; } cin >> leader >> member; for(int i =..