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;
cin>>n;
vector<pair<int, pair<int, int> > >v;
for(int i = 1, t, a, b; i <= n; i++)
{
cin>>t>>a>>b;
v.push_back({t, {a, b}});
}
int ans = 0, ans1 = 0, ar[9] = {-1, -1, -1, -1, -1, -1, -1, -1, -1};
sort(v.begin(), v.end());
for(int i = 0; i < n; i++)
{
int t = v[i].first, a = v[i].second.first, b = v[i].second.second;
if(a <= 4)
ans += 100 + (((ar[a] != -1) && (t - ar[a]) <= 10) ? 50 : 0);
else
ans1 += 100 + (((ar[a] != -1) && (t - ar[a] + 1) <= 10) ? 50 : 0);
ar[a] = t;
}
cout<<ans<<" "<<ans1;
}
Compilation message (stderr)
Main.cpp: In function 'int main()':
Main.cpp:17:46: warning: unused variable 'b' [-Wunused-variable]
17 | int t = v[i].first, a = v[i].second.first, b = v[i].second.second;
| ^
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |