Submission #2285

# Submission time Handle Problem Language Result Execution time Memory
2285 2013-07-21T01:14:35 Z aakseen 개미 (GA4_ant) C++
48 / 100
332 ms 2940 KB
#include <iostream>
using namespace std;
struct squ
{
    int a, b, c, 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 256 ms 2940 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 244 ms 2940 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Correct 311 ms 2940 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 325 ms 2940 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 304 ms 2940 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 332 ms 2940 KB Output isn't correct
2 Halted 0 ms 0 KB -