Submission #2287

# Submission time Handle Problem Language Result Execution time Memory
2287 2013-07-21T01:17:58 Z aakseen 개미 (GA4_ant) C++
48 / 100
319 ms 3720 KB
#include <iostream>
using namespace std;
struct squ
{
    int a, b, c;
    unsigned long len;
};

void change(int &a, int &b)
{
    int k;
    if(a  > b)
    {
        k = a;
        a = b;
        b = k;
    }
}

int main()
{
    int num, i, j;
    cin >> num;
    squ *x = new squ[num];
    for (i = 0; i < num; i++)
    {
        cin >> x[i].a >> x[i].b >> x[i].c;
        change(x[i].a, x[i].b);
        change(x[i].a, x[i].c);
        change(x[i].b, x[i].c);
        x[i].len = ((x[i].a) + (x[i].b)) * ((x[i].a) + (x[i].b)) + ((x[i].c) * (x[i].c));
    }

    for (i = 0; i < num; i++)
        cout << x[i].len << endl;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 265 ms 3720 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 258 ms 3720 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Correct 289 ms 3720 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 298 ms 3720 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 278 ms 3720 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 319 ms 3720 KB Output isn't correct
2 Halted 0 ms 0 KB -