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<iostream>
#include<vector>
#include<algorithm>
bool cmp(std::pair<int,int> A , std::pair<int,int> B){
return A.second<B.second;
}
int main(){
int n;
std::cin>>n;
std::vector<std::pair<int,int>> v;
std::vector<std::pair<int,int>>::iterator it;
for(int i=0 ; i<n ;i++){
int x,y,z;
std::cin>>x>>y>>z;
v.push_back(std::make_pair(x,y));
}
std::sort(v.begin(),v.end(),cmp);
int x = v.begin()->second;
int y = v.begin()->first;
int ans1 = 0;
int ans2 = 0;
if(x<5){
ans1 = 100;
}
else{
ans2 = 100;
}
for( it = v.begin()+1 ; it!=v.end() ; it++){
int a = it->second;
int b = it->first;
if(a==x && abs(y-b)<=10 && a<5){
ans1 = ans1 + 150;
}
else if(a==x && abs(y-b)<=10 && a>4){
ans2 = ans2 + 150;
}
else if(a>4){
ans2 = ans2 + 100;
}
else if(a<5){
ans1 = ans1 + 100;
}
x = a;
y = b;
}
std::cout << ans1 << " " << ans2 << std::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... |