Source Code
#include <iostream>
#include <math.h>
using namespace std;

int main() {
	int n;
	cin >> n;

	long long int* pi = new long long int[n];
	long long int* ci = new long long int[n];

	int total = 0;

	for (int i = 0; i < n; i++) {
		cin >> pi[i] >> ci[i];

		if (pi[i] > ci[i])
			total += pi[i];
		else
			total += ci[i];
	}

	cout << total;
}
Copy
Two Teams Qusay
GNU G++17
3 ms
604 KB
Wrong Answer