Submission #2377

#TimeUsernameProblemLanguageResultExecution timeMemory
2377hgp744개미 (GA4_ant)C++98
100 / 100
62 ms1376 KiB
#include <iostream> #include <stdio.h> using namespace std; int main() { long long n,a[8],k,i,j; scanf("%lld",&n); for(k=1;k<=n;k++) { scanf("%lld%lld%lld",&a[1],&a[2],&a[3]); if(!a[1]) printf("%lld\n",a[2]*a[2]+a[3]*a[3]); else { for(i=1;i<=2;i++) for(j=i+1;j<=3;j++) if(a[i]>a[j]) { a[i]=a[i]+a[j];a[j]=a[i]-a[j];a[i]=a[i]-a[j]; } printf("%lld\n",a[1]*a[1]+a[2]*a[2]+a[3]*a[3]+2*a[1]*a[2]); } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...