#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
int main() 
{
  ll n;
  cin>>n;
  vector<pair<ll,ll>>pa,bb;
  ll p=0;
  ll s=0;
  for(ll i=0;i<n;i++){
    ll t,b,c;
    cin>>t>>b>>c;
    if(b<5){
      p+=100;
      pa.pb({t,b});
    }
    else{
      s+=100;
      bb.pb({t,b});
    }
  }
  
  for(ll i=1;i<pa.size();i++){
    if(pa[i].first-pa[i-1].first<=10 and pa[i].second==pa[i-1].second){
      p+=50;
    }
  }
  for(ll i=1;i<bb.size();i++){ 
    if(bb[i].first-bb[i-1].first<=10 and bb[i].second==bb[i-1].second){
      s+=50;
    }
  }
  cout<<p<<" "<<s;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... |