Submission #659411

#TimeUsernameProblemLanguageResultExecution timeMemory
659411KenparLjeto (COCI21_ljeto)C++17
50 / 50
1 ms320 KiB
#include "bits/stdc++.h"
using namespace std;

#define ll long long
#define endl '\n'

const ll MOD = 1e9+7;
const ll INF = 1e16;
const ll MAX = 2 * 1e5;

void solve(){
	int n;
	cin>>n;
	ll ans1 = 0, ans2 = 0;

	vector<int> last(9, -11);

	for(int i = 0; i < n; i++){
		int t,a,b;

		cin>>t>>a>>b;

		if(a <= 4) {
			ans1+=100;

			if(t - last[a] <= 10){
				ans1+=50;
			}

			last[a] = t;
		}else{
			ans2+=100;

			if(t - last[a] <= 10){
				ans2+=50;
			}

			last[a] = t;
		}
	}

	cout<<ans1<<" "<<ans2;
}


int main()
{
	cin.tie(NULL);
	ios::sync_with_stdio(NULL);
	int t = 1;

	//cin >> t;

	while(t--){
		//cout<<"Case #"<<t<<" > "<<endl;
		solve();

		cout<<endl;
	}
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...