프로그래머스 알고리즘 kit 완전탐색 - 모의고사 (C++)
·
알고리즘/프로그래머스
문제 풀이% 연산자로 순회하기#include #include using namespace std;vector solution(vector answers) { vector answer; vector> type; type.push_back({1,2,3,4,5}); type.push_back({2,1,2,3,2,4,2,5}); type.push_back({3,3,1,1,2,2,4,4,5,5}); vector score(3,0); // 점수 카운트 용.[0,0,0]으로 초기화 for(int i=0;i maxScore) maxScore = score[i]; } for(int i=0;i