This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h> 
#include <cctype>
using namespace std; 
#define fi first
#define se second
#define int long long
#define all(v) v.begin(), v.end()
#define pb push_back
#define rep(i, a, b) for (int i = a; i <= b; i++)
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> ii;
typedef pair<string, ii> sii;
typedef pair<int, ii> iii;
const int INF = 3e18;
const long double EPS = 10e-9;
const ll MOD = 1e9+7;
signed main() {
	ios_base::sync_with_stdio(0); cin.tie(); cout.tie();
	int n; cin >> n;
	vector<int> last(8 + 2, - INF);
	int scorea = 0, scoreb = 0;
	for (int i=1; i<=n; i++) {
		int t, a, b; cin >> t >> a >> b;
		if (a > 4) {
			scoreb += 100;
			if (t - last[a] <= 10) scoreb += 50;
			last[a] = t;
		} else {
			scorea += 100;
			if (t - last[a] <= 10) scorea += 50;
			last[a] = t;
		}
	} cout << scorea << " " << scoreb << '\n';
	return 0;
} 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... |