No.1713 trick or treat!
Story (you can solve the problem without reading this)
The Halloween season has come again this year! And when it comes to Halloween, it's "trick or treat!".
By the way, what does "or" mean? Surely it must be the bitwise OR!
Which means that "!" must represent the factorial too!
Problem Statement
Find $(\mathrm{trick}\ \mathrm{or}\ \mathrm{treat})!$. Here, $\mathrm{or}$ denotes the bitwise OR, and $!$ denotes the factorial.
Constraints
- All inputs are integers.
- $1 \le \mathrm{trick},\mathrm{treat} \le 15 $
Input
$\mathrm{trick}$ $\mathrm{treat}$
Output
Output $(\mathrm{trick}\ \mathrm{or}\ \mathrm{treat})!$.
Sample
Sample 1
Input
1 2
Output
6
$(1\ \mathrm{or}\ 2)!=3! = 6$.
Sample 2
Input
5 3
Output
5040
$(5\ \mathrm{or}\ 3)!=7! = 5040$.
Sample 3
Input
15 15
Output
1307674368000
$(15\ \mathrm{or}\ 15)!=15! = 1307674368000$.
Note that the answer may not fit in a 32-bit integer.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
nok0