Submission #2275

# Submission time Handle Problem Language Result Execution time Memory
2275 2013-07-21T00:58:01 Z aakseen 개미 (GA4_ant) C++
0 / 100
0 ms 1368 KB
#include <fstream>
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;
    ifstream fin("input.txt");
    fin >> num;
    squ *x = new squ[num];
    for (i = 0; i < num; i++)
    {
        fin >> 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));
    }
    fin.close();

    ofstream fout("output.txt");
    for (i = 0; i < num; i++)
        fout << x[i].len << endl;
    fout.close();
    return 0;
}
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 1368 KB close (syscall #3) was called by the program (disallowed syscall)
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 1368 KB close (syscall #3) was called by the program (disallowed syscall)
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 1368 KB close (syscall #3) was called by the program (disallowed syscall)
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 1368 KB close (syscall #3) was called by the program (disallowed syscall)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 1368 KB close (syscall #3) was called by the program (disallowed syscall)
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 1368 KB close (syscall #3) was called by the program (disallowed syscall)
2 Halted 0 ms 0 KB -