문제는 여기! #include using namespace std; int N; vector arr; int answer = 0; void solve(){ int start = arr[0].first, end = arr[0].second; for(int i=1; i end){ answer = answer + end - start; start = arr[i].first; end = arr[i].second; } else if(arr[i].second > end){ end = arr[i].second; } } answer = answer + end - start; } void input(){ cin >> N; for(int i=0; i> x >> y; arr.push_back({x, y}); } sort(a..