# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
499567 |
2021-12-28T16:48:01 Z |
Rande |
Ljeto (COCI21_ljeto) |
C++14 |
|
1 ms |
204 KB |
#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 |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
0 ms |
204 KB |
Output is correct |
4 |
Correct |
0 ms |
204 KB |
Output is correct |
5 |
Correct |
0 ms |
204 KB |
Output is correct |
6 |
Correct |
0 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
0 ms |
204 KB |
Output is correct |
4 |
Correct |
0 ms |
204 KB |
Output is correct |
5 |
Correct |
0 ms |
204 KB |
Output is correct |
6 |
Correct |
0 ms |
204 KB |
Output is correct |
7 |
Correct |
0 ms |
204 KB |
Output is correct |
8 |
Correct |
0 ms |
204 KB |
Output is correct |
9 |
Correct |
0 ms |
204 KB |
Output is correct |
10 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
11 |
Halted |
0 ms |
0 KB |
- |