問題一覧 > 通常問題

No.1713 trick or treat!

レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 340
作問者 : nok0 / テスター : zkou ygussany
お気に入りにしたユーザー ProblemId : 7017 / 自分の提出
問題文最終更新日: 2021-10-17 00:32:42
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 319 (順位表) の他の問題:

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もしくは右上の雲マークをクリックしてアカウントを作成してください。