There are some numbers which can be expressed by the sum of factorials. For example 9, 9 = 1! + 2! + 3! . Dr. von Neumann was very interested in such numbers. So, he gives you a number n, and wants you to tell whether or not the number can be expressed by the sum of some factorials. Well, it is just a piece of case. For a given n, you will check if there are some xi, and let n equal to Σt (上标) i=1(下标) xi! (t≥1, xi≥0, xi = xj <==> i = j) t 即 Σ xi! (t≥1, xi≥0, xi = xj <==> i = j) i=1 If the answer is yes, say "YES"; otherwise, print out "NO".
输入描述:
https://www.nowcoder.com/practice/42cb1c7f7344466b8cb1710cb12d06b1?tpId=4