이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |