#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 (z % y == 0 && z / y == x)
{
result += 4;
}
if (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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1716 KB |
Output is correct |
2 |
Correct |
0 ms |
1716 KB |
Output is correct |
3 |
Runtime error |
0 ms |
1712 KB |
SIGFPE Floating point exception |
4 |
Halted |
0 ms |
0 KB |
- |