Submission #1176965

#TimeUsernameProblemLanguageResultExecution timeMemory
1176965husu1331Ljeto (COCI21_ljeto)C++20
50 / 50
1 ms328 KiB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
int main() 
{
  ll n;
  cin>>n;
  map<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;
      if(pa.count(b)>0 and t-pa[b]<=10){
        p+=50;
      }
      pa[b]=t;
    }
    else{
      s+=100;
      if(bb.count(b)>0 and t-bb[b]<=10){
        s+=50;
      }
      bb[b]=t;
    }
  }
  cout<<p<<" "<<s;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...