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;
// int main(){
// int n;
// vector<pair<int,int> > bebek;
// vector<pair<int,int> > elang;
// cin>>n;
// for(int i=1;i<=n;i++){
// int t,a,b;
// cin>>t>>a>>b;
// if(a<b)elang.push_back(make_pair(t,a));
// else bebek.push_back(make_pair(t,a));
// // first=waktu, second=orang yang lempar
// }
// int poinBebek=0,poinElang=0;
// for(int i=0;i<elang.size();i++){
// if(i==0)poinElang+=100;
// else{
// if(elang[i].second==elang[i-1].second&&elang[i].first-elang[i-1].first<=10)poinElang+=150;
// else poinElang+=100;
// }
// }
// for(int i=0;i<bebek.size();i++){
// if(i==0)poinBebek+=100;
// else{
// if(bebek[i].second==bebek[i-1].second&&bebek[i].first-bebek[i-1].first<=10)poinBebek+=150;
// else poinBebek+=100;
// }
// }
// cout<<poinElang<<' '<<poinBebek<<endl;
// return 0;
// }
// below is revised code
#include <bits/stdc++.h>
using namespace std;
int main(){
int n,bebek=0,elang=0;
cin>>n;
int lempar[9];
for(int i=1;i<=8;i++)lempar[i]=-1e9;
for(int i=1;i<=n;i++){
int t,a,b,poin=100;
cin>>t>>a>>b;
if(t-lempar[a]<=10)poin=150;
lempar[a]=t;
if(a>b)bebek+=poin;
else elang+=poin;
// first=waktu, second=orang yang lempar
}
cout<<elang<<' '<<bebek<<endl;
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... |