이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll n,i,x,y,z,t,s,j,k;
map<pair<ll,pair<ll,ll>>,ll> m;
pair<ll,pair<ll,ll>> a[3],p[110000];
int main()
{
scanf("%lld",&n);
for(i=1;i<=n;i++)
{
scanf("%lld %lld %lld",&x,&y,&z);
if(m[{x,{y,z}}]==1)
continue;
m[{x,{y,z}}]=1;
t++;
p[t]={x,{y,z}};
}
n=t;
for(i=1;i<=n;i++)
for(j=i+1;j<=n;j++)
for(k=j+1;k<=n;k++)
{
a[0]=p[i]; a[1]=p[j]; a[2]=p[k];
sort(a,a+3);
if(a[2].first==a[1].first)
continue;
if(a[1].second.first>a[0].second.first&&a[1].second.first>a[2].second.first)
{
if(a[0].second.second>a[1].second.second&&a[0].second.second>a[2].second.second)
{
s=max(s,a[2].first+a[0].second.second+a[1].second.first);
continue;
}
}
else if(a[0].second.first>a[1].second.first&&a[0].second.first>a[2].second.first)
{
if(a[1].second.second>a[0].second.second&&a[1].second.second>a[2].second.second)
{
s=max(s,a[1].second.second+a[0].second.first+a[2].first);
continue;
}
}
}
if(s==0)
s--;
printf("%lld",s);
}
컴파일 시 표준 에러 (stderr) 메시지
team.cpp: In function 'int main()':
team.cpp:9:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
9 | scanf("%lld",&n);
| ~~~~~^~~~~~~~~~~
team.cpp:12:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
12 | scanf("%lld %lld %lld",&x,&y,&z);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |