1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
   |  #include <bits/stdc++.h> #define ll long long #define MAXN 10000 using namespace std;
  int score[5][4] = {{0, 0, 0, 0}, {200, 100, 50, 25}, {100, 75, 25, 15}, {75, 25, 15, 15}, {20, 15, 10, 5}}; int type[35]; int ans;
  void solve() { 	int n, a, b, c; 	memset(type, 0, sizeof(type)); 	ans = 0; 	cin >> n; 	for (int i = 1; i <= n; i++) { 		cin >> a >> b >> c; 		type[a] = max(type[a], score[b][c]); 	} 	for (int i = 1; i <= 30; i++) { 		ans += type[i]; 	} 	cout << ans << endl; }
  int main() { 	int t; 	cin >> t; 	while (t--) 		solve(); 	return 0; }
 
  |