[C++] 프로그래머스 카펫 완전탐색
·
Algorithm/Programmers
#include #include using namespace std; vector solution(int brown, int yellow) { vector answer; for(int i = 6; i = 1이고 2 * 1이 yellow와 같기 때문에 답이므로 answer에 x길이 (i / 2)와 y의 길이 (j / 2 + 2)를 넣어주면 정답이 나온다.