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;
typedef pair<int,pair<int,int>> pll;
int main()
{
int n,db,dc,ansb=0,ansc=0,sb=0,sc=0;
cin>>n;
pll a[n];
pll b[n];
pll c[n];
for(int i=0;i<n;i++)
{
cin>>a[i].first>>a[i].second.first>>a[i].second.second;
if(a[i].second.first<=4)
{
b[sb].first=a[i].second.first;
b[sb].second.first=a[i].first;
b[sb].second.second=a[i].second.second;
sb++;
}
else
{
c[sc].first=a[i].second.first;
c[sc].second.first=a[i].first;
c[sc].second.second=a[i].second.second;
sc++;
}
}
sort(b,b+sb);
sort(c,c+sc);
if(sb>0)
{
db=b[0].second.first;
ansb+=100;
}
if(sc>0)
{
dc=c[0].second.first;
ansc+=100;
}
for(int i=1;i<sb;i++)
{
if(b[i].first==b[i-1].first)
{
if(b[i].second.first<=db+10)
{
ansb+=150;
}
else
{
ansb+=100;
}
}
else
{
ansb+=100;
}
db=b[i].second.first;
}
for(int i=1;i<sc;i++)
{
if(c[i].first==c[i-1].first)
{
if(c[i].second.first<=dc+10)
{
ansc+=150;
}
else
{
ansc+=100;
}
}
else
{
ansc+=100;
}
dc=c[i].second.first;
}
cout<<ansb<<" "<<ansc<<" ";
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... |