풀이 (성공)
#include <string>
#include <vector>
using namespace std;
int solution(int left, int right) {
int answer = 0;
vector <pair<int,int>> v;
for(int i=left; i<=right; i++){
int count=0;
for(int j=1; j<=i; j++){
if(i % j==0){
count++;
}
}
v.push_back(make_pair(i,count));
}
for(int i=0; i<v.size(); i++){
if(v[i].second % 2 ==0){
answer += v[i].first;
}else{
answer -= v[i].first;
}
}
return answer;
}