【題目敘述】https://zerojudge.tw/ShowProblem?problemid=d914
#include <iostream>
using namespace std;
int n, a, b, c, g[20][20], ans;
int main() {
cin >> n;
for (int i = 0; i < n; i++){
cin >> a >> b >> c;
if (c) g[a][b]++;
else g[a][b]--;
}
cin >> n;
for (int i = 0; i < n; i++){
cin >> a >> b >> c;
if (c) g[a][b]--;
else g[a][b]++;
}
for (int i = 1; i <= 19; i++){
for (int j = 1; j <= 19; j++){
ans += abs(g[i][j]);
}
}
cout << ans << "\n";
}