Submission #18867

# Submission time Handle Problem Language Result Execution time Memory
18867 2016-02-16T06:03:21 Z guswns0528 MathWorlds (YDX13_mathworlds) C++14
0 / 1
0 ms 1716 KB
#include <iostream>

int main(void)
{
    long long int x, y, z;
    std::cin >> x >> y >> z;

    int result = 0;
    if (x + y == z)
    {
        result += 1;
    }
    if (x - y == z)
    {
        result += 2;
    }
    if (x * y == z)
    {
        result += 4;
    }
    if (y * z == x)
    {
        result += 8;
    }
    if (__builtin_popcount(result) != 1)
    {
        std::cout << "Invalid" << std::endl;
    }
    else
    {
        std::cout << "+-*/"[__builtin_ctz(result)] << std::endl;
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1716 KB Output is correct
2 Correct 0 ms 1716 KB Output is correct
3 Correct 0 ms 1716 KB Output is correct
4 Incorrect 0 ms 1716 KB Output isn't correct
5 Halted 0 ms 0 KB -