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>
#define ll long long
#define endl '\n'
using namespace std;
void solve(){
ll n; cin>>n;
vector<pair<ll,pair<ll,ll>>>v(n);
ll asum=0;
ll bsum=0;
for(int i=0;i<n;i++){
cin>>v[i].first>>v[i].second.first>>v[i].second.second;
if(v[i].second.first==1 || v[i].second.first==2 || v[i].second.first==3 || v[i].second.first==4){
asum+=100;
}
else{
bsum+=100;
}
}
vector<vector<ll>>cnt(8);
for(int i=0;i<n;i++){
for(int j=i+1;j<n;j++){
if(v[i].second.first==v[j].second.first){
cnt[v[i].second.first-1].push_back(v[j].first-v[i].first);
}
}
}
for(int i=0;i<8;i++){
for(int j=0;j<cnt[i].size();j++){
if(cnt[i][j]<=10){
if(i==0 || i==1 || i==2 || i==3){
asum+=50;
}
else{
bsum+=50;
}
}
}
}
cout<<asum<<' '<<bsum;
// ll n,k,b,s; cin>>n>>k>>b>>s;
// priority_queue<pair<ll,ll>,vector<pair<ll,ll>>,greater<pair<ll,ll>>>pq;
// ll arr[n+1];
// ll perm[n+1];
// for(int i=1;i<=n;i++){
// cin>>perm[i];
// }
// for(int i=1;i<=n;i++){
// cin>>arr[i];
// }
// pq.push({})
}
int main(){
ll tc; tc=1;
while(tc--){
solve();
}
}
Compilation message (stderr)
Main.cpp: In function 'void solve()':
Main.cpp:30:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
30 | for(int j=0;j<cnt[i].size();j++){
| ~^~~~~~~~~~~~~~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |