Submission #2405

# Submission time Handle Problem Language Result Execution time Memory
2405 2013-07-21T08:15:31 Z pl0892029 개미 (GA4_ant) C++
100 / 100
60 ms 884 KB
#include <cstdio>

int main() {
  int T;
  scanf("%d",&T);
  while(T--) {
  	int a,b,c;
  	scanf("%d %d %d",&a,&b,&c);
    int sum = a+b+c;
    int max = -1;
    if( max < a ) max = a;
    if( max < b ) max = b;
    if( max < c ) max = c;
    
    sum -= max;
    long long ans = (long long)sum*sum + (long long)max*max;
    
    printf("%lld\n",ans);
  }
}
# Verdict Execution time Memory Grader output
1 Correct 46 ms 884 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 45 ms 884 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 48 ms 884 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 51 ms 884 KB Output is correct
2 Correct 55 ms 884 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 56 ms 884 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 57 ms 884 KB Output is correct
2 Correct 49 ms 884 KB Output is correct
3 Correct 57 ms 884 KB Output is correct
4 Correct 60 ms 884 KB Output is correct
5 Correct 57 ms 884 KB Output is correct