제출 #18871

#제출 시각아이디문제언어결과실행 시간메모리
18871guswns0528MathWorlds (YDX13_mathworlds)C++14
1 / 1
0 ms1716 KiB
#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 ((y == 0 && z == 0) || (y != 0 && z % y == 0 && z / y == x))
    {
        result += 4;
    }
    if (y != 0 && x % y == 0 && x / y == z)
    {
        result += 8;
    }
    if (__builtin_popcount(result) != 1)
    {
        std::cout << "Invalid" << std::endl;
    }
    else
    {
        std::cout << "+-*/"[__builtin_ctz(result)] << std::endl;
    }
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...