[프로그래머스 2레벨] 이모티콘 할인행사 (C++)
#include #include using namespace std;int arr[4] = {10, 20, 30, 40};vectorv;int sign, price; //가입자 및 금액void dfs(vector> users, vector emoticons){ if(v.size()==emoticons.size()) //할인율 모두 결정 { int tmp_sign = 0; int tmp_price = 0; for(int i=0; i= users[i][1]) tmp_sign++; //구매 금액이 일정량 이상이면 이모티콘 가입 else tmp_price+=tmp; //아니면 매출액에 저장 } if (tm..
프로그래머스/2레벨
2025. 5. 6. 05:06