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>
using namespace std;
#define ll long long
#define pb push_back
bool cmp(pair<ll,ll>a, pair<ll,ll>b){
if (a.first>b.first)return false;
else if (a.first==b.first && a.second>b.second) return false;
return true;
}
signed main(){
ll n; cin>>n;
vector<ll> time;
vector< pair<ll,ll>> arr, brr;
for (int i=0; i<n;i++){
ll t,a,b; cin>>t>>a>>b;
time.push_back(t);
if (a<5)arr.pb({a,t});
else brr.pb({a,t});
}
ll asize=arr.size(), bsize=brr.size();
ll bonusa=0;
sort(arr.begin(),arr.end()); sort(brr.begin(),brr.end());
// for(auto i : arr) cout << i.first << " " << i.second << endl;
for (int i=1; i<asize;i++){
// cout<<arr[i1-].first<<" "<<arr[i].second;
if (arr[i].first==arr[i-1].first){
if (arr[i].second <= arr[i-1].second+10) bonusa+=50;
}
}
ll bonusb=0;
for (int i=1; i<bsize;i++){
if (brr[i].first==brr[i-1].first){
if (brr[i].second <= brr[i-1].second+10) bonusb+=50;
}
}
ll elang=asize*100, bebek=bsize*100;
cout<<elang + bonusa<<" "<<bebek + bonusb<<endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |