추억 점수1 [프로그래머스][C++] 추억 점수 #include #include #include using namespace std; vector solution(vector name, vector yearning, vector photo) { vector answer; map scores; for(int i = 0 ; i < name.size(); i++) { // 이름별 그리움 점수 저장 scores[name[i]] = yearning[i]; } for(int i = 0; i < photo.size(); i++) { answer.push_back({0}); for(int j = 0; j < photo[i].size(); j++) { string curName = photo[i][j]; answer[i] += scores[curName]; } } r.. 2023. 9. 12. 이전 1 다음