이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <cstdio>
typedef long long ll;
ll min(ll a,ll b){ return a>b?b:a; }
ll min(ll a,ll b,ll c){ return min(min(a,b),c);}
void swap(int&a,int&b){ll tmp=a; a=b; b=tmp; }
int main(){
int tc;
scanf("%d",&tc);
int a,b,c;
for(;tc--;){
scanf("%d%d%d",&a,&b,&c);
if(a>b) swap(a,b);
if(b>c) swap(b,c);
if(a>b) swap(a,b);
if(b==0) printf("%lld\n",c*1ll*c);
else if(a==0) printf("%lld\n",c*1ll*c+b*1ll*b);
else printf("%lld\n",a*1ll*a+b*1ll*b+c*1ll*c+min(a*2ll*b,b*2ll*c,c*2ll*a));
}
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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |