"개발언어 직군 경력 소울푸드 점수"
형식"[조건] X"
형식SourceCode
#include <string> #include <vector> #include <sstream> #include <iostream> using namespace std; vector<int> solution(vector<string> info, vector<string> query) { vector<int> answer; for(int i=0; i<query.size(); i++) { int idx = 0, cnt = 0; string str, input[5]; stringstream ss(query[i]); while(ss >> str) { if(str != "and") { input[idx++] = str; } } for(int j=0; j<info.size(); j++) { int pass = 0, check = 0; idx = 0; while(idx < 4) { if(input[idx] == "-") { pass++; } else if(info[j].find(input[idx]) != string::npos) { pass++; } else { check = 1; break; } idx++; } if(check) continue; int score = stoi(info[j].substr(info[j].rfind(" "))); if(score >= stoi(input[4])) { pass++; } if(pass == 5) { cnt++; } } answer.push_back(cnt); } return answer; }
→ 효율성 테스트에서 시간 초과,,